I think it's a very good idea to seek a second opinion from another vet. You may also want to read this article -
Litterbox Problems in Cats - The Ultimate Guide
Litterbox Problems in Cats - The Ultimate Guide
We had a similar situation as Krashballz with our previous cat: her lack of litterbox compliance was an early sign of serious health problems, also most likely small cell lymphoma. We also resolved the carpet side of the problem by moving the litterbox to Brooksie's favorite spot to pee. Unfortunately, that was only a temporary solution. Brooksie was already a senior cat and she had lots of health problems.Peeing outside his litterbox was the first indication that something was wrong with my Krash as well. He also was diagnosed with small cell lymphoma. In the meantime, I remedied his peeing on the carpet by putting a new litterbox in the exact area that he was peeing. It looked awful to have a litterbox out in the wide open area of my living room, but it worked. And besides, it's not about us, it's about them and what they need us to do. I would've put a litterbox on my bed and slept next to it if that's what he needed to be happy.