Setting Collection Variable doesn't work

My question:
I have 2 collections.
In C1 I send a request to get the response value of “access_type” and set its value in the Collection variable “CollRefToken”.
This works fine. every time I POST the request, the current value of CollRefToken is being updated. The Code to set the CollVar is under “Tests” in the POST request.

In C2 I want to do the same. Same code, but here the Collection variable is not being updated. The request runs without error in both collections.

Details (like screenshots):

Collection 1 (CollRefToken is being updated)

let jsonResponse = pm.response.json();
console.log(jsonResponse);
pm.collectionVariables.set("CollRefToken", jsonResponse.access_token);
{
    "access_token": "VALUE FOR ColVar",
    "refresh_token": "xxx",
    "expires_in": 3600000,
    "token_type": "Bearer"
}

Collection 2 (CollRefTokenDev is not being updated)

let jsonResponse = pm.response.json();
console.log(jsonResponse);
pm.collectionVariables.set("CollRefTokenDev", jsonResponse.access_token);

RESPONSE

{
    "access_token": "VALUE FOR ColVar",
    "refresh_token": "xxx",
    "expires_in": 3600000,
    "token_type": "Bearer"
}

How I found the problem:
No error message when sending the request, new access token can be seen in the response, but collection variable is unchanged.

I’ve already tried:
renaming collection variable, deleting its initial value

Hi @dacreator

What’s in the Auth tab? … your first (working) screenshot has something in auth, but the second (failing) screenshot doesn’t.

Hi w4dd325,
correct, I had a look, just an old variable reference which is unused. I deleted this, shouldn’t have an effect.

I think I had some weird spelling mistake in the code, as it is working now.
Only thing I did was close Postman and try again.
Using the same code as before as far I can see.

let jsonResponse = pm.response.json();
console.log(jsonResponse);
pm.collectionVariables.set("CollRefTokenDev", jsonResponse.access_token);

Thanks for your help.