Fish don't spawn over y63(excluding lush caves) even though they are intended to spawn from y50-y64 https://www.minecraft.net/en-us/article/caves---cliffs--part-ii-out-today-java .
Spawning above y62 can also be considered a bug MC-138939
quite sure this affects 1.18+
To reproduce:
- make new world with creative and cheats enabled
- locate any ocean biome with /locatebiome or /locate biome, tp there
- stand still and run "/fill ~32 61 ~32 ~ 64 ~ glass","/fill ~31 62 ~31 ~1 63 ~1 iron_trapdoor[waterlogged=true,half=top]","/fill ~31 64 ~31 ~1 64 ~1 water","/setblock ~16 124 ~ glass","/clone ~32 61 ~32 ~ 64 ~ ~ 62 -33","/tp ~16 125 ~"
- wait 10 sec and change to spectator mode (F3+n), go down and observer that fish only spawn at y63 in to lower tank.