Exactly, OP's colleague is just a bad dev. I think without AI they would've still written a solution like that.