I am not sure I understand that workflow picture. Why was this marked resolved if it was not resolved for original poster?
I am having the same problem on 1.7.10. Deleting player dat file for any player that is crashing makes it possible for them to join until they hit same spot on the map again.
This is still an issue in 1.17.11 in Windows 10 realm world. I have 11 librarians. Two of them I made one trade with to lock their trade. I removed all the lecterns and all of them are still librarians. I logged out multiple times with no difference.