Chuck Versus the Broken Heart - S2-E18
Corrected entry: Casey needs to get Devon's hospital keycard in order to get into the secure holding area to plant the listening device into the pacemaker before it's implanted into the terrorist. They obtain the key-card by stunning him at his bachelor party and see Casey using it to access the storage facility, backed up by Chuck and Agent Forrest. We then see the terrorists scanning their leader and detecting the implanted bug - Devon is listed as the surgeon. Immediately after this, we cut to Devon waking up from his bachelor party with his keycard missing. None of the three agents involved in planting the bug could possibly have handled the operation, no other agents are mentioned as being present and, as the break-in occurred during the daytime, the staff of the busy hospital would have noticed had an unknown surgical team suddenly taking over one of their operating theatres. So Devon apparently got into the hospital with no key and did the operation while completely unconscious.
Correction: Obviously Devon was unconscious and did not show up to the surgery. There was no mystery surgical team. Hospitals have on-call or standby surgeons for emergencies or when the primary surgeon is delayed and the surgery is critical, as in this case. Because the substitution had just occurred, the patients' paper chart would probably not have been updated yet, so Devon was still listed as the surgeon and the killers went after him.