2010 rzr-s 800 stange idle

I have a 2010 RZR-S 800. Winch installed, street legal kit, and earthX lithium battery. These are the only aftermarket parts that are relevant to these problems.

Problem 1. For about a year now I’ve been having this symptom. I’ll be riding along having a grand ol’ time, and sometimes I’ll let off the gas and come to a stop, and realize that the idle is really low. Then it runs really piggy. The way I fix it is to turn the RZR off and turn it back on. The idle returns to normal and it continues running fine. This can happen up to a few times during a day ride. Any ideas?

Problem 2. Last night I went for a ride, and this was the first I’ve ever experienced this problem. We were riding along, and all of a sudden I lost everything. The speedo cluster turned off, and the engine died. Just like if I had turned the rzr off. I coast for 10 or 20 feet and everything comes back on like nothing happened and I keep driving. Never having come to a stop. This happened to me 3 or 4 times on a 15 mile ride. When we turned around to come home, it never happened again. I went on another ride trying to get it to do it again so I could diagnose, but it never happened again.

Any ideas? Could these problems be related?