I dont think mental pain is the rigth wording. Strugling may be more appropriate. Our psychological state of minds is dirrctly related to unconscious mechanism related to survival and thats related to what we live bodily and spiritually as a whole living being we feel thimgs no llm and no robot can feel. So I tend to agree with gradus_ad here. For living being there is no such thing as mental pain only as if it was only a chimera or an illusion.
Robots that feel "pain" during self damage do so because a value is inserted into a variable named "pain". The same is true of LLMs whose pain vector is stimulated by wrong behavior.
Even if they dont have an "inner sentience world" they will end up acting as of they do and humans and designers have to think through their action space and the consequences of them probabilistically taking those actions and how it will affect humans and the real world