Try again with Opus 4.5
Try again with Sonnet 4
Try again with GPT-4.1
Here I thought these things were supposed to be able to handle twelve lines of code, but they just get worse.