I wasn’t saying entire movie. You can do a five minute trial. But we also already have Falcon and Scorpion in jail, so incarcerating him for any period of time allows significant call-backs to Homecoming.
Have him be on the run from the cops (assisted by Kraven?) in act one. Act 2 is him in jail and working with either Marvel lawyer, and dealing with the criminals he’s already put away. A villain coordinated breakout leads to act three, where Peter and lawyer team-up to take down the beginnings of a new Sinister Six (Falcon, Scorpion, new villain).
(If Matt is the lawyer, he fights as Daredevil. If Jennifer is the lawyer. Bruce/Hulk fights and Jennifer gets injured, setting up She-Hulk.)
Eddie Brock can show up to interview Peter (like how he interviews Cletus) for a fun cameo. Kraven can do a full hero or villain turn in the 3rd act.
Then end the film with Peter getting cleared of all charges. In a courtroom.