A monotheist who dies with faith despite committing major sins remains subject to Allah's will. Allah may forgive or punish justly; a person dying upon tawḥīd is not automatically declared eternally condemned to Hell.
Committing a sin must be distinguished from declaring the unquestionably prohibited to be lawful. These are not identical states of belief.
Repentance, hope in forgiveness, and fear of punishment remain together. Sin must not be trivialized, nor should divine mercy be despaired of.