Hello, ishikaagrawal.
Thanks for performing the steps and I am truly sorry it didn't work. It is greatly appreciated that you noticed when the issue is not happening. I will add this information to raise to our team and we will update you as soon as we get word regarding this.
Thanks for your time!
Regards,
Janette_Z
Any word on this? I just purchased a Surface Pro 7 without knowing about this issue and it's doing the same thing - shutting down randomly and frequently whenever it isn't plugged in.