By 'oil pan', did you mean as in American terminology the sump ie the finned casting underneath the engine ? I'd guess it is a part of a rocker cover gasket. Maybe left over from a previous strip down.
Looks like FOD, no relation to bike. Took a quick scan through the parts fiche just now, looking for anything that might resemble your mystery part. Nada.
So, my guess is that it's something inadvertently picked up by the valve cover when the valves were done in the past.
It sure does look like FOD*. Possibly a broken piece of a cap retainer lanyard like would be on a small lens cleaner or special lube oil bottle.
* ForeignObjectDamage - - an aviation term for small stones, twigs, metal/plastic/glass/rubber pieces usually blown or dropped onto the runway/taxiway/paved areas.
So the clues are it's 1/2" in diameter, made of rubber, and it looks like the original color was black...
My guess is that it must be the other end of the brake/clutch bleed screw nipple cover. Not the cover that goes over the bleed nipple but the other end that goes under the screw to prevent losing the nipple cover.
Interesting puzzle because it does look so very familiar. Lanyard for the bleeder sounds right enough, but the model in my mind's eye for that thing is bigger than that.