The effect of out-of-plane positional freedom is examined on the stability of two-dimensional (2D) nematic order of hard non-spherical particles using the second virial density-functional theory. The particles are allowed to move and rotate freely in the plane of confining walls and can move between the two parallel walls. The wall-to-wall distance (H) is varied between the strictly 2D and the two-layer forming cases, i.e. σ < H < 2σ, where σ is the particle’s shortest length. As expected, we observe that more and more particles are required for the formation of 2D nematics with increasing H when the rod-like particles are hard ellipsoids. Surprisingly, we found that the opposite tendency is observed in the case of hard cylinders, i.e. fewer and fewer particles are needed to stabilize the nematic order with increasing H. This paradox can be understood by projecting the three-dimensional system into a 2D mixture of particles having position-dependent aspect ratios and molecular areas. However, the complex phase behaviour found for plate-like cylindrical particles with increasing H cannot be explained in terms of the same simple geometrical arguments.