US had such fundamental problems with bomber design that you could say they were of doctrine in nature

The B-17 "Flying Fortress" had lots of guns and a crew of 10, but couldn't defend itself against German fighters

These are major oversimplifications. The USAAF doctrine, along with pretty much everyone else in the 1930s, was based on the idea that "the bomber always gets through" and that fighter and AAA (anti-aircraft artillery) would not be able to prevent bombers from reaching their targets in daylight. At the same time, USAAF strategy was constrained by the ranges expected for a campaign in the Pacific theater, necessarily requiring a longer-ranged aircraft that could not hope to be escorted by fighters. In that context, a bomber (exemplified at the time by the B-17) would have to bring its escort along with it - hence armor, heavy defensive armament, and tight combat box formations with overlapping fields of fire.

Fast forward several years, and the first year of WWII largely confirmed this doctrine, but with major caveats. Luftwaffe bombers had operated with impunity over continental Europe, and even when faced with a coordinated, RADAR-directed RAF fighter defense, they did not fail to reach their targets. What had not been expected pre-war was that this bombing would not end wars immediately, that civilian populations and industry were far more resilient than expected, and that "the bomber always gets through" did not mean that bomber losses would be acceptable in a war of attrition (indeed, losses to aircrew and aircraft would quickly limit what operations could be performed).

In light of this development, the RAF abandoned the idea of daylight bombing entirely and put their hopes in night attacks, ignorant of the extremely poor accuracy they would achieve and the strength the Luftwaffe would soon develop in RADAR-guided night fighters. Guns and armor were traded for greater bombload, but until the wholesale switch to "area bombing" and incendiaries, most of those bombs were being wasted in the German countryside. The USAAF slogged on, hoping that daylight firepower would be enough. In the end, it wasn't - losses to unescorted missions to major strategic targets were just too high - but those losses were the result of virtually the entire Luftwaffe fighter and AAA force being retasked to defend German cities and industry - consider the desperate lengths the Luftwaffe was willing to go in search of anything to counter them (near-suicidal single-use rocket rams, huge cannon in the hopes of outranging defensive armament, etc). Once escorting fighters became available in early 1944, USAAF daylight bombing became a tool not for destroying German industry, but for destroying the Luftwaffe and ensuring air superiority.

The B-29 was the first pressurized bomber, yet that just made it expensive to build since bombing accuracy at 20k feet is random, and Curtis Lemay ended up using it at 5k feet, with napalm

The B-29 was designed with several lessons in mind:

1 - AAA and fighters strugged to reach higher altitudes effectively (B-17s already flew high enough to challenge the fighters available to the Axis) so increasing service ceiling even higher would move bombers out of range of existing AAA and fighters. Reaching higher altitudes with AAA requires larger and larger guns that are correspondingly more expensive, less mobile, and easier to target in return. (Compare the road-mobile size of the 88mm FlaK-18/36/37 versus the much larger and functionally stationary 128mm FlaK 40) Fighters would struggle to reach these altitudes to intercept as well, and anything optimized for such high altitude combat would likely struggle at lower altitudes where it would be vulnerable to other fighters.

2 - The realization that war against Germany might need to be conducted without bases in the UK and that war with Japan would need to be conducted without bases in the Phillipines. This would require much greater range than any existing bomber.

Unsurprisingly, given the challenges of these requirements the B-29 was difficult to develop - the program actually costing more than the Manhattan project - and not really complete until the definitive post-war B-50. In practice, the great range would not be needed in the European theater, and the threat of Japanese fighters and AAA was greatly overestimated based on experience in Europe. In light of minimal opposition, B-29s traded guns and armor for greater bombloads and attacked at lower altitudes (often at night to reduce the fighter threat).