Instead of \Drupal::service('router.builder')->rebuild() you can invalidate route matches:
You don't need to rebuild the router table, because the static routes don't change. What you need to clear are route matches, which are calculated on the processed path and then stored for the unprocessed path. And this is ...
Your route doesn't have a parameter called node, so therefore $node is null.
In order to make node available as a parameter you have to be on a route that has node as a parameter.
So to add the node parameter to your route, you can do like this:
The _node_operation_route option respect the Use the administration theme when editing or creating content, if you want to explicitly disable admin theme for this node-related page don't use _node_operation_route
The _node_operation_route option overrides _admin_route https://api.drupal.org/api/drupal/core%21modules%21node%21src%21EventSubscriber%...