The only issue I seem to be having now is even though I have 2 joystics any game with MAME if selecting 2 player all plays off the first joystick. but so far I have only tested games that had only one joystick. I still need to test games that had multiple joysticks for players to play at the same exact time.
That's completely normal if you've ever played the actual arcade games. The only time you'll have the second controller active is on games where both players play at once.
From the distance/information provided some guesses.
As you state it works most of the time and then the custom collection loading fails: Could be that the threaded loading may have an impact.
To switch the threaded loading: Locate your es_settings.cfg (usually /opt/retropie/configs/all/emulationstation. Spot the entry <bool name="ThreadedLoading" value="<your_value>" /> and bool invert that <your_value> (e.g., true gets false and vice versa).
Then run this config for a while / for several reboots and note if your reported effect still occours.
To avoid the daunting task of re-enabling all of your collections in ES make a copy of <string name="CollectionSystemsCustom" value="yadayada,yabadaba,..."> and keep it in a safe and dry place thus you can restore it if you encounter the effect again. But only do edit your es_settings.cfg while ES is not running. And do not put an extra space between the delimiter (,) if you want to edit collectionnames manually in the editor.
Also make sure you only use ASCII characters for your collection custom-*.cfg files. (But I doubt this is the cause, as the custom collections loading would fail everytime).
Last but not least: The pugixml, which is an external lib to ES and is actually handling every xml in ES (f.i., es_settings.cfg) is a little dated (1.8 from 2016), current is 1.11.
Maybe updating remediates your issue. However, I skimmed over their releasenotes/issue tracker but did not find on a cursory look a bug directly linked to long string reading (i.e., your value of name="CollectionSystemsCustom").
But yeah, backups are good. I had done something that was causing ES to crash, once in a while, unpredictably, at launch. So I burned a fresh image, hopped on my WiFi, restored my backed-up roms and config files, and I was back in action.
Obv I have backups, but restoring from a backup onto a 256GB SD card takes hours and hours and hours and I try to avoid it wherever possible...
If you have reset RetroArch to default settings in the RGUI and then saved the config you have probably set non ideal defaults. Our defaults are not the same as the RetroArch defaults. You should remove /opt/retropie/configs/all/retroarch.cfg and reinstall retroarch from "Manage Packages/Core Packages"