How would you fill these gaps?

https://lemmy.world/post/2895486

How would you fill these gaps? - Lemmy.world

They are bigger than I was able to capture on camera beauty of water heater being in the way.

I’d probably go with some sort of split cover plate/flange (or a regular non-split one if you can disconnect it to feed it through). If you have access to a 3D printer, you can make one that way pretty easily. If not, you can probably find one at the hardware store or online that would work.
Yeah definitely use a flanged cover plate but if this goes to an exterior wall, hit the hole with some expanding foam first. Let it dry and then cut the foam flush. Then use the flanged cover.