If the imperfect stat is the same between the parents, then it’s a 1/6 chance that the imperfect stat is not passed down, and then a 1/32 chance that the stat rolls a perfect 31, resulting in a 1/192 chance.
If the parents have different imperfect stats, then it’s still a 1/192 chance, but for slightly different reasons. This time, there’s a 2/6 (1/3) chance that one of the imperfect stats is not passed down, but then the other imperfect stat needs the 1/2 chance to be inherited by the better parent. Then we once again need to hope for the 1/32 chance that the unpassend stat rolls a 31, resulting in the same 1/192 chance.
This is why most experienced players either go for 5IV Pokémon or hypertraining. It’s impossible to get rid of that 1/32 chance when breeding for a 6IV, so it’s better to bypass it altogether.