Thanks for the question! It sounds like we've got a cable tension issue! This is not uncommon at all, and the fix is typically quick and easy!
If the cable tension isn't set quite right, the position that the shifter moves the derailleur to won't align with the cogs in your cassette, and the chain will try to bounce back and forth between cogs.
It will work best if you've got somewhere you can securely hang the rear of the bike so the back tire is off the ground and you can spin the crank by hand to drive the back wheel- although you can do this while riding, it will just take a lot of start-stop-adjust-check-repeat steps.
While spinning the crank by hand as if you were pedaling at a mellow pace, use the barrel adjuster (the little knob that the cable travels through as it enters the derailleur) and turn it clockwise or counterclockwise until the noise and phantom shifting stop. You'll have to play with which way to turn it to make the noise stop. When the noise stops, doublecheck the shifting by hand-turning the cranks and using the shifter to shift up and down the range of gears.
I hope this helps! If you have questions or if this doesn't resolve the issue, please feel free to reach out to email@example.com - we've got a team of dedicated technicians who are here to assist with this stuff!