I’ve noticed something similar with vibecoded game rendering logic submitted by peers. Sometimes it will be peppered with extraneous checks for nullptr, or early returns on textures that have zero size.
I often wonder if it’s the statistical nature of the LLM mixed with a request in the prompt.