I've got a ducati 848 on a 2009 plate. That when I take the key out of the ignition the dash stays on and then flickers on and off as does the head light. Iv had the earth checked and the relay under the nose cone replaced. As well as some other relays replaced.
This fault is normally the coil/injector/pump relay. On the 848 this is on the right side of the battery box. It is awkward to get at because of the hoses. There are two relays. The front one is for the fans the rear is the one you want.
You need to change them. They are a 2 quid part that causes a whole host of problems. Unless you have a relay tester you can't tell if they are working correctly. Https://www.maplin.co.uk/p/maplin-automotive-relay-tester-a19qxh The relay should really be a service replacement item every year.