As I said before, it is very common that witnesses are not allowed in the courtroom to watch the trial prior to testifying. It would have been up to the prosecuting attorney or officer prosecuting the case to make the decision whether to call you as a witness. It may be, though, that some snafu at the courthouse left the prosecutor/officer not knowing that you were there to testify.
That may well have made a difference. The officer didn't see the accident so he would be limited in what he could say about it.

