I’ve been giving it a try on a local instance, and it seems like it might just be a current limitation of the Calculated Fields functionality…
Looks like it doesn’t have a way to differentiate a space that is used as a value, or a space that is used as formatting
I’ve also tried it by trying to escape HTML Entities such as “\ ”, but with no luck
Perhaps another user has some ideas as to how to get around this?
It would be worth raising on the Github project as a suggested enhancement, though
Though, in the meantime, it might be worth looking into Logic hooks
If you have access to the Code, then you would be able to build a quick logic hook that would be capable of replacing the spaces with dashes
Let me know if you want to pursue this, if you need any assistance