Sorry about your beer. Some unintentional sours can still be or become yummy, but it's an acquired taste. Those bucket lids/rims can be real bug traps. Spray sanitizer underneath and mop around with a sanitizer soaked washcloth. The large opening doesn't help either.
You can take samples out of buckets without removing the lid. Snake a skinny 1/4" OD hose down the grommet hole, and suck some beer out. When enough, pull the hose out so it doesn't flow back. Replace airlock.
I never met a bucket who's gasket wasn't removable. Pull that sucker out and give it a good cleaning every time. I always seem to get black crap shedding off of it even new.