Sounds like your laptop has a bad GPU which was very common on the 2008-2011 15" & 17" MacBook Pros.
FYI, the Apple Diagnostics rarely ever reported these specific GPU failures even when confirmed through other methods.
Try booting into Internet Recovery Mode using Command + Option + R instead of Command + R which will access local recovery mode located on the internal SSD. Internet Recovery Mode should take longer to boot. If you are unsure if you booted to the online installer and you are running macOS 10.13 High Sierra, then you may want to try booting into Internet Recovery Mode using Command + Option + Shift + R to access the older online macOS installer so you know for sure that you booted into the online installer. However, the older online installer won't be able to see your High Sierra installation on the internal SSD because it does not understand the new drive layout & APFS file system used by High Sierra.
If you don't have a problem booting to the online installer, then the issue may be with the internal SSD.
Unfortunately if a Mac is unable to boot to one media, it may silently revert to trying to boot to the internal SSD.
As for the Apple Diagnostics reporting an issue with a third party SSD, it may be failing because it is a third party SSD which doesn't communicate with the diagnostic as expected. There is a possibility that SSD has a problem, especially if it is the BX500 series model which tends to overheat and is known to have an extremely high rate of failure. An MX500 SSD should be fine unless it had a manufacturing defect. Another possibility for an SSD reported failure is due to the internal SATA HD Flex Cable failing....I never had any of the 2011 models with bad SATA cables, but it was a huge issue with the MBPro 13" (mid-2012) model specifically.