A pretty permalink that returns a 404 is annoying to debug when you cannot see the rules behind it. wp rewrite list prints them, so you can check whether the rule you expect exists at all.
wp rewrite list --format=csv
Each line has three columns: the regular expression that is matched against the URL path (match), the query WordPress turns it into (query) and where the rule came from (source), for example a post type, a taxonomy or other for things like the REST API.
To see which rule catches one particular path:
wp rewrite list --match=/2026/11/my-post/
And to look at the rules of one source only, use --source= with the name that appears in the source column.
If a custom post type has no rule in the list, the rules are probably stale. The fix is wp rewrite flush, and --hard also rewrites the .htaccess file. Flushing is cheap, but it should not run on every page load in a plugin, because it rebuilds the rules each time.
The list is read-only, so it is safe to run on a live site. What it shows is what WordPress has registered for that run, which includes rules added by plugins and the theme.
Further reading: wp rewrite list (WP-CLI handbook)