Whenever you click on the "-" to reduce the number of specialists in a type, that now spare population needs to be placed somewhere. The Ai is deciding on the best plot for it to go on or if it should become the citizen specialist. This is not done in the python but somewhere in the dll and or the exe.
Given that specialists almost always are taken from citizens specialists or returned to citizen specialist in this mod the easy solution would be to always use them and only try to figure out stuff if there are no citizen specialists to draw from. And as a sidenote, I've accidentally clicked on the citysquare in these transactions and the game has the same lag (or lack of lag if I'm lucky) while resetting everything to default.