I had this error too. Googling for an answer brought me here, so I bet others will come here too, so to confirm Daniel's response, I had to go deep into the module stack and republish consumers up to the end consumer.
I got the error after adding a couple fields to an Entity. The module where I was getting the Invalid Key error was in a separate module which consumed the Entity, which my module also consumed so Outsystems didn't say in my module that I needed to republish it, but since my module consumed another module, that OTHER module also had to be republished.
Republish all consumers would likely fix the error, however, ain't nobody got time for that, so I published the two core dependent modules and the error went away.