Yep spot on. Here’s the exact wording that includes that scenario -
A player in an offside position receiving the ball from an opponent who deliberately played* the ball, including by deliberate handball, is not considered to have gained an advantage, unless it was a deliberate save by any opponent.
*‘Deliberate play’ (excluding deliberate handball) is when a player has control of the ball with the possibility of:
- passing the ball to a team-mate;
- gaining possession of the ball; or
- clearing the ball (e.g. by kicking or heading it)
If the pass, attempt to gain possession or clearance by the player in control of the ball is inaccurate or unsuccessful, this does not negate the fact that the player ‘deliberately played’ the ball.