It might be a longshot, but try moving the project to a location where the path is shorter. I had a similar problem (I believe I received the same error message a few months ago, but I can't be 100% certain), where the epub failed to generate, and i tried moving my project to another location where the path to the files was shorter. This resolved the issue for me.
Many thanks for that!!
I have moved it and it does now work..... and yes the path was very long, buried away in a lowly test directory even before RH then does its generation thing and buries stuff further.
Appreciate your help
FYI – best practices have long recommended that your work should be in “c:\projects\project_name\”
Thanks for that. I should have guessed, but wasn't thinking as just messing about with test files. My poor C drive is already under strain these days with other stuff, like Storyline, that loves to be there and all that syncing to the cloud. Oh well.