Honestly, it's can be learned and is just a matter of having been there and done it over and over many times. You'll get there. All of us still make mistakes.
So how did the sub get onto the court, if neither you nor your partner beckoned him in? Sounds as if you could have had yet another technical foul. Not that I would recommend making an issue out of that one.