Let’s assume a specific Catholic confesses weekly and receives holy Communion weekly. All in good faith. Between confessions he sins no more than others in a similar life pattern. From time to time people commit sins.
During this one week he does not commit a mortal sin. He dies. However, he lived in sin for several years. Perhaps a second marriage. Perhaps missing Mass. He worked hard to live as a Christen once he realized the errors and sins of his life style. Is he going to purgatory for a long “time”?