Limp Home Mode 2007 CL600

My 2007 CL600 has unfortunately gone into the dreaded “limp home home”. I only purchased this car a week ago after having the dealership give me an inspection report where nothing regarding the transmission came up. When it first happened it seemed that it was only using second gear. Once I stopped and turned the car off for a while and then turned it back on - it was back to normal. The next day it did the same thing but now it was stuck in first gear and the check engine light came on as well. I pulled the code and got P0715. I cleared the code and the engine light went off. I took the car for a drive and it ran great until I was stuck in traffic and again it went into 2nd gear limp mode! After trying to clear the code again, the car transmission didn’t want to even engage a gear - both D and R. Turned the car off and on and it now engaged the first gear. Very, very frustrating- please can anyone help in my way forward to getting this resolved. Thank you in advance.