Why not hand over power immediately to the next person in line? Doesn't preclude the party choosing someone else when they get around to it.
Currently, this is “Working as Intended” in Canada’s political system.
It's just that in Canada, that continuity plan is reserved for unfortunate deaths. When a PM wants to resign, they basically do what Trudeau did; they announce their party will do a leadership race while they stay on as PM.
It’d cause a crisis with the monarchy but they’re not legally bound to appoint the deputy. Like you said it only applies to special circumstances, I was just addressing the legal mechanism by which it happens (as the OP talked about a PM dropping dead).