Just because Disney was involved didn't make Pirates of the Caribbean any less of a risk. Director Gore Verbinski was hesitant to take the job because he thought "the pirate genre was extinct." It probably didn't help that movies based on Disneyland rides were also generally godawful, lest we forget the animatronic creepshow that is The Country Bears, a film that rivals even Midsommar in the ursine terror department.
Disney was also freaked out because of Depp's wacky performance (although they ultimately won the "Jack Sparrow should have a nose" argument). Even once the movie was done, it was still considered an "enormous risk." And box office prognosticators kept their expectations for Pirates "muted." Of course, the movie turned out to be a smash hit, and Depp was even nominated for an Academy Award ... for playing Jack Sparrow. Yes, we double-checked, and that's an actual thing that happened in real life.