B-29s flew higher and faster than any fighter in the Japanese inventory, and their AA guns couldn't reach that high either.
That is quite incorrect. Literally bullshit.
B-29 absolute top speed: 575kph.
Cruise speed: 350 kph. This is the relevant one as otherwise range is dramatically reduced.
Ki-84 top speed: 686kph.
Even the Ki-45 twin engine fighter from 1941 can manage 540kph along with the majority of other fighters.
It´s 1944 replacement Ki-102 reaches 580kph.
The J5N(heavy bomber interceptor), despite being a design failure still reached 600kph.
No, SPEED as is was not the problem. The lack of SENSORS and coordination was.
It takes a LOT of time to reach that altitude with a fighter, 10-20 minutes or even more, and while Japan was not unable to build radar, what they had was far too few and with at best the landbased equivalent of a carrier´s air controller directing as they had no previous reason to develop the kind of systems the British and Germans(and to some extent the Soviets) created for reliable and quick interceptions.
And as for AA-guns, the Type 3 12cm and Type 5 15cm guns were both perfectly capable of reaching B-29 flight altitude, while the Type 14 10cm, Type 4 75mm and Type 99 88mm could reach there even though it was outside their effective range.
The problem of course was that the Type 3 didn´t enter service until 1943 and only 120 of them, while only 2 of the Type 5 were built in 1945 and by the time they were in service, most of the Japanese cities were already ruins after the US terrorbombing campaign.