Studio ASSIGN action ignoring IF condition result for dynamic REST URL

I’ve got a script that needs to hit different endpoints based on a custom attribute value. The logic seems sound, but the ASSIGN action keeps picking the wrong URL variable. It’s driving me nuts.

Here is the flow:

  1. Get Attribute action pulls customer_tier from the contact’s profile. Value is either GOLD or SILVER.
  2. IF action checks if customer_tier equals GOLD.
  3. If true, ASSIGN sets target_url to https://api.gold.com/data. Else, it sets target_url to https://api.silver.com/data.
  4. REST Proxy action uses {{target_url}} as the endpoint.

The problem is target_url is always https://api.silver.com/data, even when the attribute is GOLD. I checked the debug logs. The IF condition evaluates to true. The branch logic is correct. But the variable doesn’t update.

I tried putting the ASSIGN in a separate block. Same result. I tried using the Set Variable action instead of ASSIGN. Still stuck on the else value. The variable scope is set to Session for both assignments.

Is there a known issue with IF/ELSE branching and variable assignment in the same block? Or am I missing something about how evaluates these expressions? The syntax looks fine:

IF {{customer_tier}} == "GOLD"
 ASSIGN {{target_url}} = "https://api.gold.com/data"
ELSE
 ASSIGN {{target_url}} = "https://api.silver.com/data"

The REST call fails with a 404 because it hits the silver endpoint for a gold customer. I need this to work for the production release tomorrow. Any ideas why the assignment isn’t sticking?