Every time NPC initialization is required, it goes through a loop. In the event that the loop is not needed, these variables are overwritten based on the available data.
What about taking too long to react: you may have generated too many NPCs or left the game open for a long time. RenPy has a memory leak problem, so if you leave the game open for a long time, it will start going wrong.