Studying history of Halloween now, and this phrase 'social inversion' is sometimes used in the source I am reading.

In the 1890s Los Angeles developed a raucous spring fiesta that for a decade or so featured mock mayors and elements of social inversion.

Someone familiar with the meaning? I am not exactly sure I understand the true meaning, it's more or less clear but not 100%.