It isn't just the WikiTree templates that are converting the URLs, Kerry. All links to Ancestry.com in profiles and FSPs--while their original format is retained in the database so that they show in edit mode exactly as entered--will be dynamically altered when the profile is displayed in a web browser, morphed into the format that you showed in your second example. The structure of the original URL is changed and, in addition, the Rakuten Advertising preface of "linksynergy.com/deeplink?" is added so that all traffic goes through Rakuten for metrics and monitoring before being routed to Ancestry.
As an FYI, I've had word today from people in EU countries that say, because Rakuten sets somewhere around 19 individual cookies in the web browser, including trackers, when those links are clicked, that EU members are receiving notification and an opt-in choice before proceeding that isn't happening in non-EU countries. I can't directly verify that because enabling my VPN to spoof an EU address automatically blocks the cookies, anyway, and I'm routed to Ancestry's "join now" page rather than the target of the original link.