To a degree yes, but it was more about the impact of putting people into groups and having one group in power with the minimal rules over the other second group carrying a negatively charged term like prisoners. The prisoners who were under power also developed notably in less interesting ways. There are other studies that cover that whole power without rules/responsibility bwith bon group context like the milgram experiment where acting as the will of an authority figure left nearly every participant willing to execute the lone unseen test taker who was begging for their life over a speaker was analyzed &
Bonhoeffer's theory of stupidity where the how/why a charismatic leader with an us vrs them agenda unlocks crowds was explained
More importantly wrt Stanford prison experiment and the other two in the context ttrpgs like d&d 5e: the players at the table are part of a group and the gm at the table is there as a group of one. In all three, the group of players have a
role and entire forests of text about player agency good railroading bad etc while the gm without a group has a
Job rather than role. You could link the erosion of barriers in rest/recovery and removal of magic item churn as a need into a couple in various ways to give a removal of authority for the player group too.
TL;DR: Stanford prison experiment is more about groups set above other groups, players have and benefit from a group in ways that only need a group member to stand up with conviction and authority or charisma while slinging an us vrs that guy cause.