Hello, and welcome to the forum.
Have you allowed that the SOPT1 register is "write once"? This means that all bits of the register, including the STOPE bit, must be simultaneously written, usually early in the initialisation process. It is not possibly to set bits individually, and if this is what you are attempting, it may mean that the STOP instruction is never enabled, resulting in an illegal opcode reset when you attempt to enter stop mode.
Regards,
Mac