He was initially dismissed from directing the Marvel Cinematic Universe film Guardians of the Galaxy, Vol. 3 by Disney chairman Alan Horn — unilaterally, it turned out, and without consulting anyone else — shortly before production after the resurfacing of tweets he had made a decade prior that joked about rape and pedophilia.
Gunn had apologized for these tweets in the past, but they were dug up in July 2018 by alt-right political commentator Mike Cernovich, who began a campaign to get Gunn fired from the movie for them. It was later revealed that Cernovich dug up dirt against Gunn to protest Disney's firing of virulent Donald Trump supporter Roseanne Barr for her racist tweets (Gunn has made it clear on social media that he is not a fan of Trump or his policies). Although pretty much no one defended the content of Gunn's tweets, many people called out Disney for firing Gunn for years-old comments while buckling to the extremely controversial Cernovich, with many pointing out that his apology for the tweets predated his hiring by Disney and they should have known about them already.
A petition made to reinstate Gunn to the film would eventually garner 345,000 signatures, and the entire cast of the film released a signed statement in support of him (with one of them, Dave Bautista, actually threatening to quit the film and join Gunn in whatever new project he would make). Despite the pushback, and the fact that Disney didn't have anyone but Gunn in mind to direct GOTG3, since Disney was at the time trying to acquire 20th Century Fox and didn't want to show any sign of weakness, the company had no choice but to place Gunn under suspension, and officially deny from time to time that they had any plans of bringing him back, until March 2019. In the interim, Gunn decided to help out next door at the DC Extended Universe by directing The Suicide Squad and Peacemaker. Production on Guardians 3, now bumped to 2023 following the whole fiasco, is currently slated to resume after Gunn completes his DC film and series.