When we enter the Purolator tracking number into an order, Shopify always assumes it's Fedex. We can manually override this, however we use an app that handles the processing and fulfillment (RMSify) so it enters the tracking for us automatically which means we have to "update tracking" every time if we want it to show up properly in the customer's account dashboard.
If you are using a shipping software that provides the tracking number to Shopify, then you should make sure that carrier_company field is updated by the software. If it is not updated, then Shopify algorithms kick in and it tries to identify the tracking number. As a result sometimes, there is a mistake and hence it is taken as FedEx. To correct this, you can use a solution like the Shipment tracking & notify that updates the field carrier_company correctly and hence there does not arise a problem.
The only solution to this is to provide tracking number along with the courier name which will allow Shopify to identify the courier and hence provide the correct URL.