Because it’s not enough to register your rule, you need to flush the rewrite rules for it to take effect. An easy way of doing this is to visit the permalinks settings page.
This is true regardless of where the rewrite rule came from. The most common reason people encounter this is because of the rewrite rules core creates for custom post types, but this is not unique to custom post types.
Another possibility is that your rewrite rules regular expression doesn’t match the URLs you are testing, or, that another rule with higher priority matches it first. The rewrite analyser plugin or one of its competitors can help diagnose this.
Warning: A common mistake developers make to try and work around this is to flush the rewrite rules programmatically on every request so they don’t have to do it manually. This introduces bugs but it also adds a heavy performance hit that’s trivially avoided. Flush them on plugin de/activation, when you update your plugins database settings, or when user interaction requires it, and never on the frontend unless absolutely unavoidably necessary. You may see this referred to as flushing on the init
hook.