Those are some good responses!
Another simple thing you can try, given the information above... disconnect the aftermarket add-ons like the light bar, bringing the machine to its Factory equipment and then run the machine and see if the battery still dies. If not then one of the add-ons is draining your battery. If the battery still dies, remove all unnecessary fuses disconnecting their respective circuitry... leaving only the engine circuit. Run the machine again and see if the problem goes away or continues to be present. If there's still a problem check your charging system and the wiring connections. I have seen connectors come off before.
If the problem goes away, then connect one fuse at a time and see if that circuit drains your battery to identify which circuit is faulty causing the battery discharge.
Example 1, if water got into a bulb socket and rusted-out (overtime) causing a short, your lighting circuit will be the culprit that's draining your machine and this happens only when you're running the machine and you're lighting circuit is energized (consuming extra power).
Example 2, if the light bar was added splicing into the lighting circuit/wiring and it's not waterproof... corrosion... grounding or shorting in that circuit can draw extra power even if the light bar is not used.
14 volts means that your alternator is putting out (good) voltage but that doesn't mean it's pushing current, unless measured as mentioned previously. If the battery is dying, I am certain the current is drawn from the battery. Your problem may be one of these two issues, either 1) your charging system/alternator is not working properly or issues with its wiring connections or 2) there is an added load from the axillary equipment or a short in a different circuitry causing extra draw (not related to the charging system).
It's normal to throw a code if systems are starved of power and don't operate properly... regarding your throttle position sensor.
Let me know if this helps!
Yammy