"To find a valid spawn point, up to 10 attempts are made to spawn a golem within a 17×13×17 box centered on the villager (villager block position ±8 blocks along x/z axes and ±6 blocks along y axis). A random y column is picked and then the topmost block in that column is selected that is air or liquid and has a "solid-blocking" block underneath.
The target location is then checked whether the block underneath has a solid top surface (which is not the same as "solid-blocking"). The target block and 2 blocks above must not be a full block, nor be redstone-powered, nor be rails, and the two blocks above must not be water. This means the iron golem can spawn inside 1-deep water or inside blocks like slabs, fences, and carpets (if other checks pass). Adjacent blocks are irrelevant, so golems can spawn partially inside adjacent solid blocks.[2] However, the spawning iron golem still must not collide with any existing entities."
minecraft.wiki/w/Iron_Golem#S...
basically the golem is spawning with its hitbox clipped halfway into the glass wall, and the water is just pushing it straight through to the other side
the nether portal cemetery
thats why u use things like iron bars
Pal, he needs iron.
Then stone wall or fences
At first I thought this was Bedrock because only Bedrock could have this terrible bugs and then I realized it was Java. Yeah this is why people use walls for the spawning room
ummm.. what the sigma..?
what the stuff
The sigma is at a questionable amount
lol