The synchronization problem (flakiness and all the waits) is tricky to get right. Browsers are concurrent systems, and programming around one is specialized enough that many devs don’t do it well, e.g. IMO if you’re adding ad-hoc waits or nesting timeouts, you’ve already lost.
If it takes 1+ hours of work to remove a feature flag branch in an area of code, I wouldn’t trust the correctness of anything the AI writes and would be super skeptical about anything the humans had written.