MacBook Pro suddenly does not boot and acts very strange
Suddenly when booting up my MacBook Pro I got the message in the image It restarted by itself a couple of times giving the same crash message. Then it wouldn't boot at all. It would just go black midways through the boot progress bar.
After 10 attempts of hard shutdown and reboot it went into the login screen. I logged in successfully but started giving all sorts of strange error messages, as if the hard drive was read only, and went extremely slow. It took a really long time to even launch a Finder window, a Terminal or the Activity Monitor. The hard drive is SSD by the way.
I managed to restart, then got the login screen again but wouldn't accept my password! From that point and on, whenever I try to boot, I usually reach the login screen but my account has disappeared! Only the "guest" account is present, which I haven't enabled as far as I know. So I can't login, but even typing into the password prompt has huge lags, it's going really slow. Sometimes I get the initial crash screen too (that's how I managed to take the picture attached).
I tried booting with the D option to perform the hardware test. I performed an extended hardware test but no problems were reported.
I also booted with the Alt option to run the Disk Utility to check the hard drive. It didn't report any problems.
Any idea what could be wrong?
It is hard to tell in cases like this as the hardware test and Disk Utility don't always find hardware or disk errors.
However that the system can boot and run diagnostics bodes well for the hardware in the system. It sounds like it is possibly a damaged macOS install. I would be inclined to reinstall macOS right over top of what you already have there. Normally an OS install will not wipe any of your data. But, as always, verify you have a good working backup before proceeding.
If it still acts wonky after an OS reinstall I would say that you possibly have an issue with the HD/SSD and a 3rd party disk utility might be able to either tell you what is wrong and/or fix it. Failing that a visit to the Genius Bar may be in order.