Other non-MCU actors that were being considered for the role were Adam Devine, Bill Hader, Josh Gad, and Jim Parsons; among others. But, as history shook out, Ben Schwartz won the role, which in and of itself was a moment that happened thanks to Schwartz being at the right place, at the right time.
Article source: https://www.cinemablend.com/news/2494625/sonic-the-hedgehog-behind-the-scenes-facts-you-might-not-know