If Gadget fails could it delay the Manhattan project long enough for Downfall to go forward?
Sorry, just noticed this.
I actually looked at this myself a while back. Sadly, it doesn't look plausible.
The Trinity test was on July 16th, just inside the OP's allowed POD. If it fails, the bomb known as Fat Man in OTL will almost certainly be used for a second test. Having both tests fail when both devices functioned in OTL is pretty ASB to me. At least one more implosion type weapon (I believe more, but can't find reliable sources on the web) was available before the end of July.
USS Indianapolis (CA35) departed San Francisco with Little Boy's core on July 16th. She dropped it off on Tinian on the 26th and was sunk on the 30th. In OTL she stopped at Pearl on the 19th; if the Trinity Gadget had failed she might be held while scientists explain to politicians that Little Boy is just about fool proof and doesn't need to be tested.
I've yet to find an IJN submarine for her to run across while enroute to Tinian after her delay at Pearl, but that's my favored way of disposing of Little Boy. On the plus side, her distress message can get through and most of her crew is saved.
The problem is even with the Trinity Gadget destroyed in a failed test, Fat Man used in its place, and Little Boy lost at sea, there's still another implosion device available to be dropped in August. I can't find a non-ASB way to get rid of that one except political fiat; Truman decides he's fed up with all the bad luck and decides that the 3rd implosion device will be used to support the invasion, along with whatever other weapons are available at that time. That isn't at all likely IMO, but if anyone has a better idea I'd really like to hear it!
Edit to change: changed "Trinity" to "Tinian". Oops. :-(