Question broken m.2 slot or software problem?

Feb 23, 2019
I have a problem with my Acer Aspire Nitro 15 vn7-591g. I opened it recently to fix a black screen problem (cable was loose) and was surprised as I found an m.2 SSD (128gb - Kingston) inside, which I didn't even know was there. I bought the Notebook 2nd hand, and apparently it was a given back by a previous customer because that SSD only makes problems. So the seller just installed windows 10 on the 1tb HDD that is inside and sold it to me. I always planned to add an SSD drive, so I thought I just try with the one that was inside again. I took it out, put it back, and suddenly, it appears in the bios menu, so I installed an ubuntu on it. It worked. I was surprised and happy. Same evening the ubuntu crashed and the ssd didn't appear in the Bios boot menu. Then I tried the same again but installing windows this time. Now it worked for a full afternoon until it disappeared again. Additionally, while I am in my old windows 10 system that is on the HDD, that SSD appears and disappears and appears and disappears... Sooo, I bought another m.2 SSD (adata 128gb), installed it. Long story short: The same thing happens. Soooo I am wondering: Would you think it is a hardware problem like a broken M.2 slot or something in the Motherboard wiring, or might it be software problem??? I guess it's the first case but I thought I still ask. Finally, if it's one of those problems does anybody have an idea for a fix? Maybe replacing the M.2 slot (if that's really the problem)?
Anyways, I would be thankful for any kind of help.
In the worst case I will just replace the 2.5 HDD with a big SSD, but this would be more expensive, and I kind of like the idea to use all the ressources of the Notebook and not to stop using the HDD which is fully working.
Thank you very much for reading and your possible solutions!