No. Gun kills against much slower aircraft are dangerous. This is known since the 1950s when jet aircraft engaged older prop aircraft in combat and exercises. A gun doesn't grant much more kills either. We are talking about 150-250 rounds here. That is just 4-5 extra bursts.
I haven't planned any operations, therefore I will not write definite conclusions. But the rationale behind the F-35's gun feels very GWOTy to me. How reasonable it is to have an F-35 dive to strafe a convoy in a conventional war? Some people also mention CAS here. But again, data suggests that guns have horrible dispersion that precludes close support. A guided 125 kg bomb is way better.
Don't get me wrong, I am not against guns on aircraft. But really they can't be the primary tools for anything in 2023, or even secondary. It is really a tool of desperation.