Ad: This forum contains affiliate links to products on Amazon and eBay. More information in Terms and rules
The Japanese had plenty of decent engines however they seemed to have "overtuned" the Homare and DB601 copies which their next generation fighters like Ki-84 and Ki-61 were designed around. One example the re-engined Ki-61 as Ki-100 could have been built in 1942 as its Kinsei radial was already in service!
The Ki-43 did what is was built for a light fighter, the problem was that its "replacement" the Ki-61 was an unreliable nightmare, and later on the Ki-84 had many troubles on introduction, so Ki-43 had to be kept in full production even when it is 50+mph slower than newest allied types.
Japan wasted lots of resources when designing & producing plenty of competing fighter & attack aircraft designs, and some that were ot needed. Floatplane fighter by Kawainshi, dedicated land-based fighter for the IJN, too small a winged Ki 44. Three designs of CV torpedo bombers, another two or three CV-based dive bombers - all in 4-5 years. Dedicated recon aircraft (two types) is not a good use of limited resources.
The P-40 was faster than F4F, so it would be hard for the Ki-43 to be faster than P-40. Zero, once it got improved Sakae, was faster than F4F.
Looks like the Zero got the improved exhausts earlier than the Ki-43, that gained some 20 km/h once installed.
As for what the IJA brass wanted, there was only so much the radials of initially 900 HP can afford.
Whether resources were well spent or wasted is only measurable in retrospect. Each design is always based on the perceived need at the time it is conceived. Every air force was guilty of investing in aircraft that failed to meet expectations, yet it is the death knell of an air force that eschews development of newer and better types.