Function node not working after update

node-red-contrib-deconz has (had) a known issues with prototype pollution affecting the new code editor: 🎉 Node-RED 2.0 Released - #43 by Steve-Mcl

However, I have not seen the behaviour you describe before - though I would not be surprised if this was the result of latest node-red version + version of Monaco + node v18 + old contrib nodes

I suspect however Node V18 would be OK if all your contrib nodes had been updated (since others are using Node V18).