When judges dismiss a criminal trial vs a cop, yes, he is most likely legally innocent. I will also point out that the accuser had no facial bruising as reported, his reported comments about she hit me first were false, and he was arrested on probable cause based solely on a complaint made pending further investigation. The complaint was he grabbed her by the wrist and physically threw her out into the hallway causing scrapes and bruises. Not only did she have social media posts the day after showing no scrapes and bruises but the security camera never showed her being thrown in the hallway. On top of that several exes of Avenatti said he was never abusive towards them.
I will also freely admit that police get a lot of false claims against them. All the more reason to have as much video/audio evidence as possible. And people who purposely make false claims on cops should to prison for a long time.
Edit - you might have been thinking of civil trials. If the judge tosses the case based on qualified immunity (which judges made up out of thin air and is not a law) they are saying that ignorance of the law is an acceptable reason for a cop to break the law and in no way proves innocence or guilt.