I had this same issue for a while and accidentally solved it.
Go to your bot's settings in Copilot Studio, then Generative AI, then change the setting from Classic to Generative AI.
At least for me, once I changed this setting the error went away and I could publish again.