Mazda 6 suddenly causes problems

Hello, only yesterday I bought a Mazda 6. During the visit as well as the test drive and the long way home of almost 400 kilometers and various tank stops there were no problems. Only when I just wanted to go to work begins the “fun”. I got in and everything worked as it should, not 300 meters away from the front door I had to stop at a gyro and suddenly the engine went out. He jumped immediately again but since then he runs terribly restless and took only garkein gas more on and then suddenly he shot high at the pedal. From about 2000 revolutions everything sounds quite normal and I can also hold it high up to 6000 revolutions. As soon as I release the pedal, however, it immediately drops to zero and goes off and it starts to run and seems to run normally in idle, no strange noises nothing, as soon as I then give gas again starts the fun from the front off and goes off or it starts or starts at the lower speed z I noticed that in the higher speed range, the TCS/DSC light starts to flash. The MKL glows permanently. I just tried to disconnect the battery to eliminate the error. Strangely enough, this also worked. The car started to start and started to run straight away, at the moment when I pressed the accelerator pedal but everything started again from the front… I immediately called the seller in Nuremberg and asked him what he sold to me. But he thinks that he never had such problems, he drove the car himself until yesterday and also to the registration office he drove the car, he was only registered yesterday. So what can that be? Did I really buy a car with engine damage or can possibly be something smaller behind it? I don’t know, because at least all my savings for the car went on yesterday… And it would be fatal if he turned out to be a scrap. I hope m The car was built in 2002 with the 2.3 liter machine and 166 hp.