Grounds can be the bane of one's existence.
Further to @PSIG post, grounding can play havoc with ECU function, engine sync and other aspects - had this issue with mine. All unused ECU ground connections must be tied to the main ECU main ground wire.
This video by Andy Whittle is good viewing. To test for ground issues with an ECU, disconnect the ECU from the wiring harness. Test for continuity between sensor ground(s) and main ECU ground wire at the wiring harness. Continuity, you have an issue, no continuity - good. Video web site:
https://www.youtube.com/watch?v=EJ2TeodWDUE Check minute 7:46.
This video supports @PSIG premise that all grounds terminate at the same place. If the grounds on your vehicle do not terminate at the same place (use the frame), ensure that the essential engine parts/components and the ECU use the same engine ground point before the battery. Grounds that do not affect engine or ECU operation are not as critical.
You can also reroute "dirty", noisy grounds from the ECU grounding system. These are fuel pumps, rad fans; not many but could be enough to be annoying. The picture posted by @PSIG is a good example of using the engine as the main ground, but have the grounds connected at different spots. The engine block is a good noise filter between grounding points.
My Honda Goldwing 1200 FI model uses the wiring harness to direct the grounds to the motorcycle frame, then to the engine block, then to the battery. I have changed this so that the essential grounds go directly to the engine block, bypassing the frame, then to the battery. Wiring and connections degrade over time.
Will follow. Good luck.