updating rewrite rules is a funny thing in WP and requires flushing the rewrite rules in key places. For example during plugin activation or deactivation. If you add rules after the cache has been created WP will not recognize them. For more information on this see the codex here https://codex.wordpress.org/Rewrite_API/flush_rules