As discussed in this question, Shankaracharya entered body of the king to gain knowledge.
A similar instance is described in Mahabharata, where a Brahmin Sanyasin enters body of king Dharmadhyaja, of Janaka's race, to learn about Moksha. The king while explaining her actions, records the sins committees by her: sanyasi having desires, Brahmin and Kshatriya inter-varna mixing, married but another relationship, etc.
The king even says:
...it is evident that thou desirest to humiliate them all and glorify thyself (at their expense). Stupefied by thy pride of Yoga-puissance that has been born of thy jealousy (at sight of my power,) thou hast caused a union of thy understanding with mine and thereby hast really mingled together nectar with poison.
My question is, comparing this to Shankaracharya's actions, are they not also against the righteousness? For victory, he used his powers, engaged in acts which are not prescribed, and potentially harmed a chaste queen as well.
I read the answers in the question on this topic but it doesn't answer. If, whatever started in Madhaviya Digvijaya is to highlight the powers Shankaracharya had, isn't it kind of own goal? The passage I quoted above clearly says it's wrong.