Once you have made a call to wix-location.to() with a url that contains a query, then every subsequent link, even from the menu or buttons, has the query appended.
This happens even after editing the site, republishing, and reloading the page!
And if you call wix-location.to() with a url with a different query, then that query just gets appended to the first.
These three query parameters are after the site has been edited twice, republished,and reloaded.
There appears to be no way to clear the query.
Amazing.
A workaround (which I was using before I decided to be ‘clever’ and use a url query) is to store the needed parameter(s) in either session or local storage. Then to ‘get’ it on the target page, and, importantly, clear it.
//Before call to wixLocation.to(url)
local.setItem('parameterName', parameterValue)
// and on the target page
let parameterValue = local.getItem('parameterName');
local.setItem('parameterName', ''); // forget the parameterValue for the next time this page loads