I just had a similar issue yesterday on 2020 1500 5.3. But my brakes didn't apply, there was just no brake pedal and I almost ran into an intersection. I had all the codes come up service esc, trailer brake, etc. Knowing that these trucks are extremely finicky with low-voltage batteries I put my Noco battery charger on it to see what the volt percentage came out to which was 25% . Not the best reading but the only one I could get at that moment. I cleared all the codes and left the charger on until it read 100%. I Drove it a short distance and everything seems fine so far but man GM has got to get this fixed before someone gets seriously injured with no brakes. A Low battery voltage battery should never disable brakes if that is the cause.
I need to drive it more to see if it is truly fixed, but from everyone who has posted similar issues like this none have ever gotten a for-sure cause. The codes that came up on the scan tool were the ones that everyone gets but, the thing that stuck out to me was comm error low voltage across multiple modules which made me check the battery first. I hope this helps. Hopefully, someone who has gotten a good answer will chime in...