A client recently informed me that some of the blog posts were getting 404 errors. I set about to investigate the issue and discovered that the client was indeed correct.
The permalink settings were set to post name, so I just tried re-saving the settings, which often fixes these kind of problems. This time, my re-save did not work. I noticed the posts appeared on the Archive page, which made it even more mysterious. Then, I started looking trough all page and post types on the site and discovered 2 pages in Trash with the same slug as the problematic posts. Permanently deleting the posts solved the problem and the posts display normally.