I had a '99 CLK320, and while I didn't have all your crazy issues, I did have the trans computer take a dump which forced it into limp mode and stuck in second gear from that point on. At least it was second so I could drive faster, I can't imagine being stuck in first. Holding the eng at 3k is nothing so I wouldn't worry. I don't really see an issue with 4k either, assuming you're not doing it for an hour a day for weeks on end. When mine failed I drove it ~4-5k to my destination ~15 miles away, and made maybe 20 round trips until I fixed it. Plus many misc shorter trips.
After troubleshooting, which was mostly the same stuff you did minus the codes since I didn't have a way to get them, I bought a used TCU online. Ebay I think, for ~$200 and that fixed it. I was stoked! It was a 5-speed trans like yours and the TCU was under the pass carpet like yours etc.
So if you decide to buy one, I recall something about the TCU having to have a certain #, like a model or serial # or something that had to be correct for my VIN or trans code or something. If not "they" claim it won't work. So fyi if you want to buy one.
As for P0400, well, for me there was only one way to get that code to go away in that same car; sell the car! Like many codes I get in various cars, there is nothing actually wrong with said part. My EGR worked perfectly and all the passages were surprizingly clean. I drove it for like 4 years with that frikkin code. I removed the check eng light bulb. Even the dealer could not tell me what all goes into triggering the code so I could troubleshoot. When I asked the service manager it was clear he didn't really know how it all worked, and online sources were of little help.
I did want to share this video with you:
I'd watch the whole thing but I really wanted to show you the hose starting at 1:38, which is kinda hidden and I guess vexes people.
Please post what you discover for both issues, it helps others! Most people just post questions but never the fix so the next poor guy has nothing to go on. Thanx, and good luck!