WAIT A MINUTE! Just looked through the summonrandomspirit function again and saw this line:
potentialalternateswap(dice2);
Which should have been this line:
montype[loop] = potentialalternateswap(dice2);
Which means the game is not considering the new spirits, and YES, this could crash (or more likely freeze) the game! Thank you!