Sounds like you are already done. Glad you found it.
The right way would be to pull the water heater out of the opening a few inches, then do the putty tape repair. Then caulk over it. For future readers, caulk is an extra defense. Putty tape is supposed to be the main barrier.
Since you only did the caulk, be sure to keep an eye on it in the future.
Also, take a look at the bare screw heads in the WH flange. If the putty is lacking behind them, they will be a source of leakage and eventual rot. You might want to caulk them now. Back each screw out a bit, put a small blob of caulk (size of a pencil eraser) on the screw, and snug it back up.