gabenet,
You are doing what many people do, you are thinking of a football rule rather than a basketball one. In football rules, there are certain situations where a player that goes out of bounds cannot be the first to make a play or touch the ball. In basketball this principle does not apply. Basketball only allows a player to be inbounds and touch the ball if they are considered inbounds by location. Basically the last part of the floor they touch is where they are located on the floor by rule (there are exceptions). Do not feel bad, many others think the same thing. As a matter of fact many people have asked this question lately. It is starting to get as common as "if a shooter shoots an airball, is it travelling if they get the ball first?" But I am sure TH will disagree with that. He disagrees with everything else I say.
Peace