It works in pre-interview filtering rounds because companies hiring processes are usually broken and the smartest people are not working on those aspect.
If, on the actual job, you're copy-pasting buggy ChatGPT code, someone will notice. If the other people at the company don't notice and do something about it, the company isn't likely to survive for too long.