First of all, thanks a million for sharing a workflow that makes it easy to reproduce the problem. It makes it so much easier to understand and solve such problems.
Now for the problem itself, this ultimately comes down to the expression you have in use here. An expression like $('Node name').item will use a technology called item linking (or sometimes “paired items”). This allows n8n to identify the related item from a previous node, even if the order or number of items has changed along the way. n8n nodes implement this by attaching meta data to each item they receive and pass on. For this to work with the Code node, the metadata would have to be provided by your code (documented here).
However, seeing you have only a single item, it might be much easier to use a slightly different expression instead of updating your custom code in multiple nodes. If you go with {{ $('SetVars').first().json["url"] }} n8n will always read the first (and only) item from your SetVars node without the need for any data about linked items. You can find a full list of available expressions here.