From the answer https://math.stackexchange.com/a/3743490/ the "impossibility" of the Penrose triangle and the Escher cube in Euclidean space arises because they violate the condition that a closed loop of orthogonal edges must return to the same $z$-coordinate. In Nil geometry, the $z$-coordinate is coupled to the area swept out in the horizontal ($x,y$) plane. A closed loop in the $x,y$ plane (like a square) creates a vertical shift proportional to its area.
I wonder if the impossible cube can be embedded isometrically into a curved three-dimensional space such that its edges are also geodesics.
▲ In a standard Euclidean cube, the faces are merely adjacent; in the "impossible" embedding, the boundary curves of the faces can become topologically linked.