Definitely sounds like it thinks the bonnet is open, the reason I mentioned speed was because when I had my 2020 C Class the bonnet warning would only activate on the main road after leaving my estate. Very annoying after quickly checking fluids before driving. As I previously mentioned, I'd check the bonnet was closed properly. Open the bonnet and to close it lower it to about 8 inches and then let it drop. That should secure the latch properly. It can look secure and closed but it may not be. If it is still playing up then it could be the sensor as mention by a previous poster.