The complete list of closure causes can be found here.
It was very difficult for me to find the reason why my Mac was closing randomly, so I hope this helped you! Although most of the solutions given online recommend that the SMC restore, do not do it before making a backup copy of your data.
If you choose to use the built -in time machine, see this:
#Mac #randomly #find #terminal