You could try and remove the parts affected..........or just leave it and deal with it at harvest.
Caterpillars (little black crumbs are their poop and a give away sign to their presence) can bore into the buds and cause damge, but they generally don't cause bud rot, which is something else all together.
It does not look like you have bud rot, just a plant pest.
Bud rot will be all mushy inside the flowers and usually the first sign of it is many dead leaves around the affected bud.
I would not spray anything onto the plant this close to harvest..............no matter how safe it claims to be.
Removal of affected parts may be the safest solution regardless of the cause.