It depends.
You are the floor at the location where you are standing. If any part of you is OOB, it is an OOB violation. If you are BC, it is a violation when A touches the ball again (if B doesn't touch it first).
By rule, if you catch it inbounds, you should just drop the ball at that spot. If, however, it was a pass that was obviously going to go OOB, and there was no chance either team would get to it, I'd do what you did.
Oh, yeah, watch some films of football umpires, and learn how to duck!