Probability of i event_A and j event_B on n dice
P(i successes) = ((# of ways to get i 6s and no 5s) + (# of ways to get i-1 6s and some 5s)) / 6^n
(# of ways to get i 6s and no 5s) = (n choose i) * 1^i * 4^(n-i) [pick which dice must be 6s, 1 way for each of those to be a 6, 4 ways for each of the others to be neither 6 nor 5]
(# of ways to get i-1 6s and some 5s) = (n choose i-i) * 1^(i-1) * (5^(n-(i-1)) -
4^(n-(i-1))) [pick which dice must be 6s, 1 way for each of those to be a 6, 5 ways for each of the others to be non-6 except then we're overcounting by the 4^(n-(i-1)) ways that they are ALL neither 6 nor 5]
Dropping the unnecessary powers of 1, overall your probability can be computed exactly as:

[Note: I am using the convention that (n choose -1)=0, unlike Python's math.comb which does not allow negative inputs.]