Thank you very much for the response. I debugged with the Notification as you suggested and discovered that the PrevTask was actually being set to the current task being edited. This is probably because the task had finished by that point. I was able to find a workaround with this knowledge, so the issue is resolved.
Thank you again for the help!