It's always been a mess of an issue since at least the 1800s.
The proper spelling in Portuguese has been ‘Brasil’ since they made it official in 1945.
The more common spelling in English has always been ‘Brazil’, and was not corrected, thus much of the world follows suit.
https://duckduckgo.com/?q=Brasil+or+Brazil
Thumbnail
there doesn't seem to be anything here