Yeah Sampson is right.
If it hits a defender and is on target it would go down as Ricardo, but because it comes off a team mate it goes down as N’Didi.
The ball hits N’Didi and completely changes direction. The most unintentional goal he will ever score in his career, but it goes down as his.
To throw a hypothetical scenario up, if N’Didi is in an offside position the goal gets ruled out, because it clearly hits him.