I press one bytton and the other changes color. Is this the desired effect? It not maybe the X axis of the touch controller is inverted. But this is not a problem, just a remark.
I see a few possibles here, there touch controller could be slightly different due to supply issues or source of manufacture so that could mean the x/y value could be inverted.
I also have seen two different lcd's on the same board number both from same supplier but a few month apart, this also could be cause of inverted lcd x/y.
I personally dont use the stm libs so cant really help you there but i there is a command you can send the lcd to rotate it (MADM command)
i would also print the touch co-ords on screen to assist with that.
darkspr1te