Outdoor grow?
Happens to me every year as I live in a very wet climate.
I know people say to chuck the whole thing.
I never do. I cut out the moldy parts, water well, add some fresh compost, and let her get on with it.
The spray might play a part here. Check airflow, too. Wet buds need air to dry!
Cut leaves, stems, whatever is restricting airflow around flowers.