I was just clearing a village with commands on my super flat world and I decided to put a fletcher in a cage to see what would happen if I spawned an end gateway on him using commands but it didn't do anything so I decided to destroy all the workstations but I missed the fletcher one and deleted it with commands and the fletcher villager stayed a fletcher and didn't lose his job.
Duplicate of MC-149835