In The Sims, an engagement to a deceased Sim can be resolved with a bit of in-game effort. If you run into the ghost around the house, you can talk to them directly to adjust the relationship.
With cheats enabled, you can add the ghost to your active household, or pursue a science career to restore them at the facility. Once the ghost is present, choosing friendly interactions like asking to just be friends helps dissolve the romantic tie. Keeping the required item in your inventory is important for these steps.