Reading from serial. Works in sample-js file, but when running in node-red serial port gets closed

That was a really nasty error.
I've tried with built-in serial node and got the same error: Serialport was closed upon first receiving char.
I've tested on another Node-RED instance. There it worked. Problem cost me a few hours, but still I don't know where it came from.
I've renamed .node-red directory and reinstalled it on that machine and now everything works as it should.