The target's turn is not ended
Reaching through the illusion created by mental prison could involve making an attack through the illusion (which, for a creature with Multiattack or Extra Attack, means that they still get to make more attacks after the spell ends), or simply reaching through the illusion with any body part (in which case they'd still have their action, bonus action, movement, unless a DM ruled that reaching through the illusion used up an action or bonus action, but they'd still have movement and either action or bonus action).
If the target is moved out of the illusion, makes a melee attack through it, or reaches any part of its body through it, the target takes 10d10 psychic damage, and the spell ends. (XGtE, p. 161)
Assuming they survive the 10d10 psychic damage, nothing in the spell description says that their turn ends when the spell ends.