How to fix 404 error on portfolio items and portfolio 2nd page

This error is displayed because you have changed the permalinks recently or the portfolio slug.

Go to permalinks and set to ‘Default’, save. Then set again to ‘postname’ or the permalink you want and save again. This will do the fix.
This will force WP to rewrite the .htaccess file and to save the new rewrite rules in the database.