Strange leak from toilet refill valve
In the end, I confirmed that that is not the normal way of working by checking the other bathroom (the thought of having one only occurred to me some weeks later, as I don't usually use it).
In that one, a cloth had been strapped on the top of the valve, so that water that would come out from there would not be able to go far but would stay inside, so I assumed the same problem had arisen and they solved it that way.
I thought of using the same trick, but I didn't because it would create a place for mold to grow and I wanted to avoid that. Instead I added a rectangular piece of plastic in the foam in the back so that the jet cannot reach the cover, and cannot go outside.