Ninjutsu ability and the stack
The scenario you describe cannot happen. Once you have finished activating the Ninjutsu ability, the chosen creature has already returned to your hand without other players being able to interfere with that.
The reason for that is that returning the attacking creature is a cost of the ability. By the time anyone can react to the Ninjutsu going on the stack , the creature is already in your hand.
Furthermore, Ninjutsu does not target the creature you return to your hand, so it can't become illegal. Targets are reserved for effects, not for costs.
For clarity: the wording for activated abilities is always &quot;cost : effect&quot;

602.2. To activate an ability is to put it onto the stack and pay its costs, so that it will eventually resolve and have its effect. [..]
602.2b The remainder of the process for activating an ability is identical to the process for casting a spell listed in rules 601.2b–i. Those rules apply to activating an ability just as they apply to casting a spell. An activated ability’s analog to a spell’s mana cost (as referenced in rule 601.2f) is its activation cost.
601.2c The player announces his or her choice of an appropriate player, object, or zone for each target the spell requires.[..]
601.2f The player determines the total cost of the spell.
601.2h The player pays the total cost in any order. [..]
601.2i Once the steps described in 601.2a–h are completed, effects that modify the characteristics of the spell as it’s cast are applied, then the spell becomes cast. Any abilities that trigger when a spell is cast or put onto the stack trigger at this time. If the spell’s controller had priority before casting it, he or she gets priority.

Note especially the last sentence of 601.2i. Only after a spell or ability is finished casting/activating (in particular after all costs have been paid) does any player get priority, i.e. the ability to cast other spells/abilites.