A company I worked for in the ‘90s had a guy like that. Put deliberate bugs in the code so that he could fix them later. He got fired when it was discovered.
I had some Russian offshores, back in the late 90’s, who would write the most convoluted code possible.
I finally asked one of them why. He told me, “In the former Soviet Union, to keep your developer job, you had to be the only one who could maintain it.”