Whether proxy_pass rewrites the request URI depends on whether the directive's value contains a URI component. With location /api/ { proxy_pass http://backend; } the full original path is passed through, so a request for /api/users reaches the upstream as /api/users. With proxy_pass http://backend/; the matched location prefix is replaced by that URI, so the same request arrives as /users.
A single trailing slash therefore changes the upstream path. This is the most common cause of a proxy returning the upstream's 404 page for every request.
Two further rules matter. If the location is defined by a regular expression, or if the location is inside a named location, the URI form of proxy_pass is not allowed and nginx fails to start. And if rewrite has already modified the URI inside the location, the rewritten URI is used and the replacement does not happen. Verify the actual upstream path by logging $uri and $request_uri or by reading the upstream's own access log rather than reasoning about the rules.