I think the reason why the Boro goal was given is because N'Diaye touched the ball before it went to de Roon. Surely when the ball was headed forward de Roon was in an offside position and the slight touch doesn't play him onside.
The reason why it was given was because the linesman thought this occurred, you're correct. Unfortunately for the linesman that's not what happened.