Just throwing this out as another possibility/long shot, buddy of mine had a 5.3 doing something similar. He was running an over oiled foam air filter that gunked up his mass air flow sensor and we suspect also gunked up the idle control valve. Cleaned the mass air flow sensor and it started to run much better. About two months later he started to experience similar symptoms as your stalling out and some error codes. Cleaned the gunked up idle control valve and it fixed his issue. Doubt it’s your problem but figured I would throw it out there.