The refs followed the rules, but the rules need to change.
In soccer if a guy is injured on the other team, you kick the ball out of bounds. When the player gets off the field and play resumes, the other team gives you the ball back.
Basketball should have a courtesy like that if the refs aren't gonna do something.