No. Mossadegh was appointed by the Shah (who was still head of state), but his own autocratic actions such as dissolving parliament and giving himself autocratic powers pushed most political forces against him that a confrontation was inevitable. There is a reason the military stood back as he was disposed. Furthermore, the Shah did actually have the legal right to fire Mossadegh, when je ignored that the situation was already extra legal.
I don't know where you are reading history from but listening to random factoids rather than a comprehensive understanding is the worst way to do so.
From my understanding your retelling of history is a minority view. For instance, it is in conflict with Wikipedia.
It’s commonly accepted that Mossadegh was thrown out by a coup and that Khomenei seized power through a revolution.