How to (truly) alter a URL in Drupal 8
The module weight won't do anything here. You set the priority in the service tag.
You have to look what other path processors do at which priority to find the right place for your custom code. And use an inbound path processor to remove the x you have added outbound.
The outbound processor is called multiple times while building a page, because you usually have more than one link on the site (and not all are visible).
(question in comments) You can do this, outbound transfer query parameters to the path and inbound transfer parts of the path again back to the query parameters. Internally Drupal sees only the short base path with query parameters, externally you see the full path without query parameters. An example for inbound is PathProcessorFiles::processInbound