What have I done wrong?

You are using a tutorial from 3 years ago that claims it only worked on Raspbian / RetroPie, at no time does the tutorial say it is compatible with Recalbox.

I'm not a developer, and I can't tell if the script is compatible or not, I can't test it, nor do I have enough technical knowledge to help you with that.

Maybe this will help you: