You are absolutely correct that rainfall before during and after physiological maturity results in fungal infections of seeds which has deleterious effects on the seed quality and its performance.
At the yellow and tan color pod maturity the physiological resistance to seedborne microbes is minimized.
Assuring optimal watering just before flowering and to early pod stages can be sufficient to stimulate yield and quality but moisture on pod surfaces at just before and after physiological maturity will stimulate deleterious seed infections.