There's a million things it "could" be. You already know what my experience was.
If you fix everything else, and still get 50-series codes, you're probably going to have to replace the ECM and see what happens...but...DOWNLOAD THE SERVICE MANUAL SET for your vehicle, and follow the diagnostic procedures for the codes.
If you fix everything else, and still get 50-series codes, you're probably going to have to replace the ECM and see what happens...but...DOWNLOAD THE SERVICE MANUAL SET for your vehicle, and follow the diagnostic procedures for the codes.