Using a dynamic content / liquid tag inside a campaign email link

I am currently unable to use a dynamic content / liquid variable inside of a link when using the campaign builder.

[%- assign finalURL = "" -%]
<a href="[[ finalURL ]]" target="_blank">Update Email Preferences</a>

This works correctly if I use it in an email broadcast. It also works correctly when I preview the email inside the campaign builder. But once the campaign is published, the URL is converted to a redirect link, and that redirect link returns a 404 error.

(Note: I’ve simplified the code down to the single point of failure and tested it at this point of failure. This is where it breaks. I could obviously just use the finalURL in the link if it were this simple, but I am using other dynamic content tags to populate URL parameters.)