There does seem to be an issue here, or I too am misunderstanding it.
I have an Out node publishing with the Retain flag set, and two In nodes, one with Keep set and one with it not set. As I understand it, on publishing a message then the subscriber should see msg.retain set according to the Keep flag, but it is set in both cases
[{"id":"310782544a09a97e","type":"mqtt out","z":"bdd7be38.d3b55","name":"","topic":"test/testretained","qos":"0","retain":"true","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"adf2dac3.b20fe8","x":520,"y":2120,"wires":[]},{"id":"53ea2ca73a91f2eb","type":"mqtt in","z":"bdd7be38.d3b55","name":"Don't keep retained flag","topic":"test/testretained","qos":"2","datatype":"auto-detect","broker":"adf2dac3.b20fe8","nl":false,"rap":false,"rh":0,"inputs":0,"x":240,"y":2180,"wires":[["9061500bbf32ed93"]]},{"id":"9061500bbf32ed93","type":"debug","z":"bdd7be38.d3b55","name":"debug 99","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":420,"y":2180,"wires":[]},{"id":"bab8ee4c7cda13cf","type":"inject","z":"bdd7be38.d3b55","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":140,"y":2120,"wires":[["310782544a09a97e"]]},{"id":"1bbd8c1f2edfbeb9","type":"mqtt in","z":"bdd7be38.d3b55","name":"Keep retained flag","topic":"test/testretained","qos":"2","datatype":"auto-detect","broker":"adf2dac3.b20fe8","nl":false,"rap":true,"rh":0,"inputs":0,"x":230,"y":2240,"wires":[["860c3b9007cf85c4"]]},{"id":"860c3b9007cf85c4","type":"debug","z":"bdd7be38.d3b55","name":"debug 100","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":420,"y":2240,"wires":[]},{"id":"adf2dac3.b20fe8","type":"mqtt-broker","name":"localhost V5","broker":"localhost","port":"1883","clientid":"","autoConnect":true,"usetls":false,"protocolVersion":"5","keepalive":"60","cleansession":true,"birthTopic":"tigger/LWT","birthQos":"0","birthPayload":"Online","birthMsg":{},"closeTopic":"tigger/LWT","closeQos":"0","closePayload":"Offline","closeMsg":{},"willTopic":"tigger.LWT","willQos":"0","willPayload":"Offline","willMsg":{},"userProps":"","sessionExpiry":""}]
I have also had it lock into the situation where neither of the received messages have that flag set, but I haven't worked out what triggers that. A node red restart fixed that.
Node red 3.0.2 with nodejs 18