Chatting elsewhere, as the problem appears to be with the ‘next’ and ‘previous’ post links, so I have commented out that part of single.php.
However, as I’d like to actually fix whatever the function is that’s causing this crash, if anyone can help, I’m not marking the topic as resolved.