Priority doesn't seem to follow the longest length = highest priority

I am seeing odd behavior related to two similar rules.

http:
  routers:
    trans_legacy_accounts_documents_to_documents_route:
      entryPoints:
        - "legacy_accounts"
      middlewares: 
        - "add_documents_host_name"
      rule: "Method(`GET`,`POST`,`PUT`,`PATCH`) && ( PathPrefix(`/api/documents`, `/api/document_contents`, `/api/document_content_formats`, `/api/document_types`) || Path(`/api/users/{id:[0-9]+}/accept_legal_documents`) )"
      service: "documents"
      priority: 10

and this one...

http:
  routers:
    trans_legacy_users_to_users_route:
      entryPoints:
        - "legacy_accounts"
      middlewares: 
        - "add_users_host_name"
      rule: "Method(`GET`,`POST`,`PUT`,`PATCH`) && PathPrefix(`/api/users/{id:[0-9]+}`,`/api/users`,`/api/user_edit_logs`)"
      service: "users"
      priority: 10

With this config I am expecting that requests that match /api/users/{id:[0-9]+}/accept_legal_documents will go to the documents service. However, that's not what's happening. Those requests are getting routed to the users service. What am I missing here?

Why do you set equal priority on both routers?

The two routes I sent in the example are two out of a large list of routes being used. We have a setup where we use 10 as the "default priority", 1 as a "catch_all" priority used to catch anything not defined elsewhere, and 20 as an override priority to force specific routes to take precedence over any other route/rule. So pretty much all the normal routes are set to 10.
In most cases, this works fine because the "longest rule = highest precedence" seems to be working as expected. Just this one instance is behaving weird.
To get it working I went in and changed the priority to 11 on the /accept_legal_documents route. Works fine now. Just don't like things I don't understand and I don't understand why it didn't work as it's written in my post.

If you set the rules with equal priority, it will be rather random which one matches first, depending on the internal program structure how they access the config variables within Traefik.

I was thinking of it the wrong way. I was thinking that the priority: 10 when specified acted like an override. But if two routes had the same priority specified then the longest rule = highest priority would then be used to set priority within that subset of routes with matching priorities.

Thanks for your help. I understand now what was occurring.