Very, very big if, but it would cause a major backlash since McCarthy would attempt to dismantle Biden's policies and overreach instead of serving as a caretaker. Back in the 1970s when this was a discussion after Agnew resigned and Nixon was scandal-plagued with Watergate, then Democratic speaker Carl Albert said he'd step aside in case Nixon falls before a vice president was inaugurated or appoint a Republican after the voters entrusted a Republican with the presidency in the previous election. Needless to say that McCarthy wouldn't do so.
I think there would be a wide open field of Democratic candidates, but not nearly as big as 2020. I think Gretchen Whitmer would be good money to bet on.
Albert actually did all he could not to become President, by confirming Ford & Rockefeller swiftly, partly because it’d have been seen by some as a coup. Perhaps a more interesting question is if Harris died and there was a chance of impeaching Biden, would McCarthy try to let a new be sworn in or go for removal and making himself President.