It's not unusual for my initial output (as a programmer) not to compile either. I wouldn't say I "failed" if I can then get it to compile. Which as people are saying, is what happens with Claude Code and Opus, either automatically or at most when I say "get it to compile".
Something is really wrong with your setup and I can't tell what it is from these high-level descriptions. Would you be willing to hop on a videochat and walk through this simple case? I'd be really curious to figure out what's going on, it's pretty atypical.