Howdy all..... (first post on this forum)
It sounds as though the officials really blew this one... Unless the trail official was sure that over 4.5 seconds had expired (why would he have a count on, since he knew there were less than 5 seconds remaining), you have to count the basket. I think you could be "sure" that catching, shooting and the time it takes for the ball to go through the basket would consume 2 seconds minimum. I would put 2.5 seconds on the clock and allow the other team to inbounds as normal....the problem of course, is that they have the advantage of inbounding with the clock stopped....
maybe this is a good time to mention that in these situations, it is good to "remind" the timekeeper before you administer the ball at the sideline, "Make sure you start the clock at my signal, (chopping in)", which would hopefully alleviate this disaster.