A question on init and activation hooks

I think you’re mistaken and the activation didn’t work correctly: you won’t have the new post type set up in the permalinks cache.

Here’s activate_plugin() in 5.4. You can see the sequence is

  • wp-admin/plugins.php loads without the new plugin; init is triggered now
  • activate_plugin() PHP-includes the new plugin, loading it and registering its hooks; it’s now too late for the plugin’s init hook to be called
  • activate_plugin() calls the global activate_plugin hook
  • activate_plugin() calls the plugin-specific activate hook

So if you’re relying on the init hook to register your post type in the activation case it won’t have been called before flush_rewrite_rules(). Not that you’ll see any errors here, but the new post type won’t be set up in the permalink cache.

(That all is unless, on the very off chance you have an activate_plugin hook that triggers init, but that seems unlikely and definitely isn’t the default.)