Bike making random noises after being lubricated
First, what you have is a bike with derailleur gears. The derailleur itself is the mechanism that moves the chain onto one of several sprockets mounted on the rear wheel hub to achieve different gear ratios. The sprockets can be referred to as a sprocket cluster. Many people also call it a cassette (although that properly refers to sprockets mounted in a particular way).

The sprockets themselves do not need lubricating, only the chain does. Excessive lubrication can be dangerous if oil gets on the tires, braking surfaces on the rims (or discs on new bikes) or brake pads. It also tends to make a nasty mess, getting on the frame, wheels, legs and clothing.

What I would do is give the bike a good clean, using a degreaser product to remove the excess oil on the sprockets and chain. There are decent citrus based ones available that work well and are not expensive. There are many Youtube videos out there that will show you how to properly clean a bike including the sprockets and chain (example below).

Buy some bicycle chain specific lubricant and re-lube the chain. Bike chain lube may seem expensive but it lasts a long time because you only need a drop on each joint in the chain.

From you description it's hard to say what's causing the noise, but it seems likely it's connected to the freewheel ratchet mechanism if it only occurs when freewheeling. I doubt it is due to excessive oil on the sprockets. If you are not mechanically inclined I'd have a good local bike repair shop check the rear wheel. Even if the noise isn't dangerous it's super annoying for a part to break on a ride and leave you stranded.