I have not had much success in solving this problem. A contract that does not give errors and that is flattened correctly. Here is the topic:
error Unable to generate Contract ByteCode and ABI
Then we will have to look for another strategy and ask.
What is the correct way to publish and verify a contract from hardhat on a testnet or mainet?