Is it a mortal sin to miss mass if one believes they will die if they leave their house through mental illness?
No, if one truly believes they will die if they leave the house then it would not be a mortal sin. But, if one is in such a condition they should seek help to overcome it.
Those with mental illness need professional help from a therapist. For their spiritual care, they should seek assistance from their priest, who can bring the Eucharist and other sacraments to them such as Anointing and Reconciliation.
Let’s remember mass obligation is a positive law, it does not bind those for whom it is morally or physically impossible to fulfill.