Wanted to add some additional context to this as I have also had a very similar problem and I didn't see the root cause discussed in these replies. So for anyone who may come across this via a Google search, hope this helps.
While I can't speak to why this happened so quickly to the OP, I also have a 2018 Compass and it has the ESS system, I bought it used in 2020. Initially I had a problem that was related to the battery where the ESS shut the engine off at a stop light, and when it started the car again I had a warning that the ESS system needed service and I noticed that my battery was not being charged while driving. Eventually it did die at a stop sign two blocks from my house, we were able to get it jumped and it ran fine after that, acted like it never had an issue. I took it to the dealer and they replaced the ESS battery under the (3 year) warranty.
About a year after that I had another issue. Again ESS had turned the engine off at a stoplight but when it went to start again the whole dash lit up with every warning light and individual system failure message you can think of. I was able to get it limped into a nearby parking lot where I let it sit for a while. After about 20 minutes I was able to start it with none of those warnings present at all, again the car was acting like nothing was wrong. Took it to the dealer and they replaced my main battery, which makes sense as since it's a 2018 and I'm pretty sure that battery had never been replaced previously it had been in the car since it was built in 2017.
I believe I was able to figure out more about the ESS system thanks to other posts on this forum, but I can't remember who made the posts or where they are. I'll add links to this reply if I can find them. The ESS system in the Compass has two batteries, both are AGM as
@Eugene@2018 mentioned. The ESS battery is responsible for running the accessories while the car is off, and your main battery is used to start the car again. There's a "smart relay" that switches between the two and has some other special sauce to make sure the batteries are capable of running the system.
Based on my experiences, it seems that if your ESS battery has failed/is failing, the system switches back to the main battery but might not do what it needs to in order to have that battery get charged by the alternator. It's possible that it disconnects the alternator from this circuit on purpose as a safety feature. I believe the best course of action for this if it's the first occurrence or an isolated incident is to park, turn the car off, wait for a minute or two, and then start it again. See if the ESS service message shows up and disable the ESS using the button by the shifter. Keep an eye on it for a few days and if you see the ESS service message again (I often see it after remote starting the car for some reason, even when nothing is otherwise wrong with it) take it to get serviced.
If your main battery is failing or otherwise near the end of its service life, you may experience the more "dramatic" version of these experiences. I'm no mechanic and I barely understand how this ESS works, but to me it seems like the complete meltdown condition happens when the ESS goes to start the engine and switch back to the main battery and the main battery does not have the cranking amps to start the engine quickly enough to have the load transferred back to it. This results in sensors not being powered fully or at all, the ECU freaking out because it can't see sensors or it gets readings that indicate complete failure, and then the ECU sticking the car into "limp" mode. You may not notice the battery's in need of replacement if you don't use the ESS or if it's not consistently near or below freezing outside. All of the batteries I've replaced in previous vehicles I did so after noticing it struggled more in the winter months with starting the car, and even in this case with my Compass it didn't seem to be struggling more than usual so my usual warning signs were not there even though the battery was due for replacement.
If there's anyone else that can elaborate at all on anything I said or correct anything I am wrong about, please chime in. I'd love to be able to actually fully understand this system.
Side note: It is kind of funny to me that this issue seems to be most common with the 2018 Compass models, which seems to follow along with the issues with the Renegade's AC system where they weren't getting enough refrigerant put into the system at the factory. Seems Jeep had a few bugs to work out of these models