I might be wrong, but it's likely the context settings are cached so when you try to call makeUrl it uses the cached site_url instead of the dynamically set value. I've run into similar issues with this previously.
It shouldn't be a big code change to use the relative makeUrl call; I would go with that instead of using up all your time trying to find the perfect solution.