To fix this follow the steps below:
- Go to Dashboard > Settings > Permalinks and change the permalink structure to something else and save the changes.
- Set the permalink structure back to the desired format and save again.
Now all the post types should be displayed correctly.