Take a look at the PAS sensor in the rear right chainstay right up close to the derailleur hanger. The side facing the ring of magnets in the cassette lock nut should be 3mm from those magnets. If it’s not, there is a little grubscrew in the frame/chainstay , hidden underneath (it faces down). Ithink it’s 2mm. Loosen than, push the sensor closer to the magnets, retighten and try that. I had same fault, was told to buy a new sensor for €50, then tried adjusting first. It takes 2 minutes and worked. The sensor was at least 10mm from the magnets. Oh! Try cleaning the sensor and magnets first!