Heidi Klum's ex managed to do what's seemingly impossible -- get busted for mushrooms at Burning Man.

According to docs obtained by TMZ ... Vito Schnabel was arrested September 3 by Pershing County Sheriffs and charged with distribution and manufacture of a controlled substance ... a felony.

In the report, prosecutors say Vito was in possession of Psilocybin -- the scientific name for psychedelic 'shrooms ... which is a Schedule I controlled substance. He's pled not guilty.

Vito's no stranger to Burning Man. He was there last year with Heidi. They split up Monday after a 3-year relationship. 

Vito faces up to 5 years in prison if convicted. We've reached out to him, so far no word back.