Update: I installed Fabric without mods, and the issue still persists. But when I install Iris (without any shaders), the issue disappeared. Something is wrong with vanilla renderer.
I can't seem to reproduce this issue in 1.17.1. Please provide some additional attachments of this problem occurring whilst the F3 debug screen is enabled.
Update: I installed Fabric without mods, and the issue still persists. But when I install Iris (without any shaders), the issue disappeared. Something is wrong with vanilla renderer.