Crash on system only (no error in browser or simulator)


I've got this pretty crazy crash happening in my Pulp game.
This only happens on the playdate itself and not in the testing software.
I am usually pretty good at figuring out bugs, but I have been having an impossible time with this in the last three days and thirty some builds.
The error seems meaningless, and by commenting out lines of code, I can establish no pattern of what could cause this. I know how to cause the error in the game (it's using a crank function enough.) There are crazy random bits that I can comment out that will prevent the bug.
It involves a lot of code and if you think you could help at all, I'll share anything you would like to look at.

here's my transcription of what the error says since the picture is kinda blurry

bad argument #1 to '?' (value out of range)
stack traceback:
 [C]: in fucntion 'string.char'
 ?: in function <?:1968>
 (...tail calls...)
 ?: in funciton <?:1241>
 (...tail calls...)
 ?: in function <?:1757>
 (...tail calls...)
 ?: in function <?:1387>
 (...tail calls...)
 ?: in function <?:1368>
 (...tail calls...)
 ?: in upvalue '?'
 ?: in upvalue '?'
 ?: in function <?:1401>
 (...tail calls...)
 ?: in function <?:1368>

some of those numbers might be wrong, but I don't expect that mattering. if it does, I can get more crashes pretty easily

To explain better what I am doing, each time the crank is used, a string is cleared out and remade with five embed tiles based on how much the crank has been used. That string is drawn on the screen actively.

There are about 250 different options based on the crank and game state. It seems that if I disable enough of the possibilities, the crash never happens.

Is it possible that there is a limit to the number of different tiles you ever have embedded? It only ever uses 5 at a time, but perhaps there is something in the back that keeps every embedded icon you use and there is a limit to how much it can keep track of?