url parameter doesn't need to be encoded as Url::fromUri expects un-encoded query parameters
Pardon me, this is my first contrib on drupal git. Let me know if I'm messing up any expected standards.
I found, per the documentation, $url_params['url'] does not need to be urlencoded because line 284 Url::fromUri expects unencoded parameters per docs. https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Url.php/function/Url%3A%3AfromUri/9.0.x