@diebstahl I'm pretty sure I fixed it and it wasn't the script's fault.
In my /boot/recalbox-user-config.txt there was various settings at the end for the NESPi4Case and Retroflag cases. For example:
dtoverlay=gpio-poweroff,gpiopin=4,active_low=1,input=1
I commented these out and the install script worked without error. The fan is now running. Hope it helps.
Now I just need to work out why my 8bitdo Pro 2 controllers keep losing connection.