A friend of mine has a junior engineer who does this and then responds to questions like "Why did you do X?" with "I didn't, Claude did, I don't know why".
Developers aren't hired to write code that's never run (at least in my opinion). We're also responsible for running the code/keeping it running.
And if it was repeated... Well I would probably get fired...
And not just from juniors