I think it’s a know slight issue on Arm JIT
https://github.com/BlitterStudio/amiberry-lite/issues/4
https://github.com/BlitterStudio/amiberry/issues/1125
I found JIT to be a little less stable than it is with winuae/ x86, Turning it off or tweaking setting in emulation config can help, also amiberry updates fixed a few issue I was running into in the past, so it good it getting more stable.
I think you are right.
There must be an issue with my A600GS setup, since it apears not to change anything if I turn JIT off or On. And the sysinfo readings I get suggests that JIT is enabled always.
To test this theory I did replace the SD card with one with a regular OrangePI linux install on. There I have Amiberry-Lite v5.7.5 installed. Turning off JIT and it runs without the error, with JIT on it acts just as on the A600GS setup.
Also I edited the script a bit to avoid the "crash with error" situation. This script will cause the program to run without premature exit, but will reveal that JIT messes up the sequence of reading tables in Hollywood.
With JIT it will count up from 100, but skip the number 102. Then when it counts down it will skip 102 again, and jump to 101, 100, and then 102.
Hollywood script:
UndoStack1 = CreateList()
SetFillStyle(#FILLCOLOR)
counter = 100
For i = 1 To 10
InsertItem(UndoStack1, counter)
Local undoBrushID1 = GetItem(UndoStack1, ListItems(UndoStack1)-1)
Wait(40)
Box(300, 100, 50, 20, #BLACK)
TextOut(300, 100, undoBrushID1)
counter = counter+1
Next
Wait(50)
For i = 1 To 10
Box(300, 100, 50, 20, #BLACK)
Local undoBrushID1 = GetItem(UndoStack1, ListItems(UndoStack1)-1)
TextOut(300, 100, undoBrushID1)
Wait(40)
RemoveItem(UndoStack1, ListItems(UndoStack1) - 1)
Next
WaitLeftMouse