I've had a really terrible time getting LLM to properly handle errors as return values. It seems that bubbling up errors, in a side channel, to a contextually relevant point in the code (exceptions) seems MUCH easier for LLM to reason about/implement properly.
Maybe my problem is I'm using a language with exceptions, so trying to go against the statistical grain, with return values, is just too much.
Exceptions are inherently better for high-level code, where basically every loc can fail and 99% of the time you only want to bubble that up. You only want errors as values in systems code, where exceptions would be landmines. Rust and Go both did that because they were at least originally designed for systems code.
Also, Go makes it way too easy to accidentally swallow an error. Rust doesn't have that problem.