Could you also share your whole workflow here, just so we can get an idea of the bigger picture and how you’re pulling in your data? You can just hit cmd/ctrl a + cmd/ctrl + c on the workflow editor, and then paste that here on the forums between two sets of three backticks (```).
Taking a closer look, you’re not manually adding in the ability to use linked/paired items in your code node - expressions like .item won’t work in this case. I know it’s the default when you use the drag and drop, which might have led you a little astray
So you have two solutions here - include linked items in your custom code, or have the code node return everything required in the email node (which means you wouldn’t read from anything before the code node if you do this).
Taking a peek, you might want to change this across both the Code and Code 2 nodes - it looks like you’re getting your binary data through the HTTP Request node, correct? In that case you can use something like {{ $('HTTP Request').item.binary.dataR }} to access it in your node labelled Code, and do the same but with the Code node output in Code 2 as it looks like it renames the files for you. Let me know if that helps!