Well, flak was not exactly nonexistent in the attack roles the Beaufighter did well, especially antishipping, where the chance of surviving a tour of ops was the worst of any mission, being rather low for one tour and around 15% for two.
But the USAAF thought it would be a good idea to use A-26's instead of P-47's for the CAS and tactical ground attack roles. The "Invader" proved to be just as fast as the P-47 at low altitude, capable of carrying more ordnance, and was at least as fiercely armed as the T-Bolt, having at least six and as much as fourteen .50 cal. But while the A-26 was a better attack aircraft than the P-47, the USAAF found it was so much larger that it had a significantly greater chance of being hit. So the A-26's in the ETO were used mainly on medium altitude bombing missions. And even though the B-26s had side package guns they almost never used them. A B-26 navigator who was on them in the ETO said there was only ONE occasion where they were told to deliver their bombloads and then go down and strafe the target area. On that same mission the bombardier relished finally getting to use that .50 cal in the nose, although it required the Norden bombsight to be removed to do so and the navigator got the job of holding the Norden while the bombardier had his fun.
Interestingly enough, some Mossie equipped units in the Far East had their aircraft replaced by Beaus. The bugs and fungus in that area loved munching on that plywood held together by glue that was based on milk.