I’m experiencing the exact same issue after updating to WordPress 6.8.
Just like you, I couldn’t add or edit any posts or pages — an unexpected error shows up every time. After running the site through troubleshooting mode, it also pointed to the Yoast SEO plugin as the source of the problem.
To keep working, I had to disable Yoast and temporarily install Rank Math instead.
Hopefully, this gets fixed soon!