First check the lean angle sensor is still mounted correctly.
It's in front of the battery and has the word UP written on the top of it.
It should be mounted with the top level with the bike.
Also check it is connected correctly and that the wires to it are not shorting to the frame.
They do fail often and need replacements but can be checked with a multimeter .
There is a procedure in the manual.
If its mounted properly you can try giving it a couple of taps with a screw dri or handle as maybe the internal pendulum is stuck.