Is this really a teaching of your church.
Do me a favor and look at my post #68 and post #104.
at the moment of your death when those who deny the Catholic Church will have to answer for their sins.
I probably wouldn't have phrased it that way.
Yes, if a person dies with unforgiven mortal sin on their soul, they will have some major problems.
And only the churches that have apostolic succession have authentic sacraments, one of which is the sacrament of reconciliation (a/k/a penance, a/k/a confession), which are the ordinary means whereby God dispenses His graces (although He is not limited to those ordinary means, dependence on an extraordinary means is not advisable).
And abandoning communion with the Body of Christ (a/k/a the Bride of Christ, a/k/a the Church established by Christ on the day of Pentecost) is objectively grave matter.
Having said that, for grave matter to be a mortal sin, one must have full knowledge and deliberate intent. In other words, it must be objectively grave. You have to know in your heart that it is objectively grave. And you must deliberately intend to do so anyway. That is a pretty high standard to meet. Not to say that it isn't ever met in the case of heresy or schism, but I think it's a lot less likely than some of us believe.
The point is that yeah...that is a teaching of our Church...but with a whole lot of caveats that have to be weighed in.
That's why I generally don't approach things that way.