I don't know what would have happened if the Midway came out differently. I guess the final outcome would have been the same, but it might have taken longer.
You are correct. Even if the USN lost all 3 carriers at Midway and the Japs lost none, the outcome would still be the same. By 1 July 1944 we would have 10 Essex class, 9 Independence class and 50 Casablanca class carriers in commission. The Japanese were doomed even if we had a terrible defeat at Midway.
If Midway would have “turned” out “differently”(Japs TAKE Midway) then Pearl Harbor would have been FINISHED as a forward base and the US Navy would have had to return and fight the war from the US West Coast. The War in the Pacifice would have EASILY gone into 1947 or 1948.