Pages counts are showing in WordPress backend but pages shows 404

Kindly switch to any of the default themes and check if the issue persists, most of the times it solves the issue. If it does then there is some issue with the the theme you are using. Also make sure you are using latest php version. If even after switching the theme it doesn’t work then you have make sure all plugins which you have installed (whether activated are not) are supported for the wordpress version you are using, try deleting all the plugins one by one and check simultaneously.

Make sure you keep backup before doing anything