So I visited the dealer this morning and the Genius guy was as puzzled as I was by the issue. We were trying things back and forth and the lid/hatchet/panel/whatever-you-call-that-thing would not open at all. He was starting to think that it was some kind of electric failure when suddenly, he pushed it and it popped open. It's been opening correctly for a few hours now.
We don't really know what the problem was. Most likely it was solved by a [random] combination of resetting the system -by pushing the volume button for a few seconds-, locking the car, unlocking, starting it, reseting it again, locking, unlocking, and then for no reason at all... it was fixed.
I'll keep an eye on it and update here if the issue repeats again. Thanks for the suggestions.