I’ve come across two potential solutions, but I am unsure if they are the recommended ones:
Removing locale variable in the middleware, like $request->route()->forgetParameter('locale')
Ignoring the params defined in controller methods and instead use route params, like $request->route('id')