Tasks showing as remaining even though completed

In my sidebar I have some notifications for tasks remaining, even though the projects themselves are completed. However, many other completed projects are showing up correctly, with no notifications. I cannot see any systematic difference between the two sets of projects that might be causing the persistent notifications. The false notifications make it difficult for me to see at a glance which projects have remaining actions.

On further investigation it seems that I can get rid of the false notifications by deleting the due dates of completed projects - but this shouldn’t be necessary.