i am having the exact same problem with my 02 540it and giving an update to what i have done for others who may come across this thread. for me it started pretty rapidly one day the car had a very irregular throttle response in the first couple of miles of driving, then settled out no problem. a few days later it really started hiccuping and got the Engine Failure Prog on the hi-OBC. shut the car off. started it up, then drove fine till i stopped for lunch. of course 35 miles from home. started the car and went only a mile before the Engine Failure Prog came on again and was only allowed to drive 30mph. no SES light. i pulled out my code reader just in case, but still nothing. started it back up after eating lunch, we got it to go ran fine, so i put in new Shell 93 just to be sure it was not the rotgut gas i got in SC for $2.98 89octane. we were able to get to the boat. on the way home from the boat when i came to a hill and was approaching the top of the hill i completely eased off the gas and the car started hiccuping again. this time the SES light came on along with the EFP message. stopped at a gas station and read the codes. p0120 and p0221 were the only codes. reading the codes indicated a good chance that i was the pedal. i stomped on it a few times before starting the car again. it ran fine for a while until i got on the highway again. once again the EFP message showed up when i was coasting. hmm. stomped on the pedal a few times, then off i went again. whenever i would just start the car i would almost immediately get the EFP message. only every now and then would i get the SES light. i kept the code reader up in front with me on the way home to clear and check as soon as i could to see if anything really bad were to show up. the strange thing is that sometimes the car would run fine even though the EFP message was in the OBC. i finally got home. after about 5-6 restarts. annoying.
doing some research i decided to start with the pedal since, for me stomping on the pedal seemed to semi correct it. this all happened on Sunday. i tried disconnecting the pedal and checking all connections on the MAF and throttle body but as soon as i started the car it would hiccup and EFP would show up. i just got done installing the new pedal and resetting the computer (left neg terminal undone for about an hour or so, i was doing other stuff, so not sure exactly, but long enough to clear things out). the new pedal definitely felt firmer. not sure if this is just normal wear and tear feeling or an indicator that things are not so good with the pedal. the wagon started right up and i was able to drive about 4 miles completely trouble free. i know that it is just a short test. i will hopefully give it a better test in the next couple of days.
i was hoping to get my VAG KKL cable in before the pedal came to see what exactly is showing up on a GT1 to give even better feedback. hopefully i will not get the chance to test the GT1 with this particular problem. the next step if this does not work and i do not have the GT1 working properly would be to get a used known good Throttle body to see if that does it. though it does seem that this could be a sign that my DME is having issues. i am planning on flashing my DME anyway to get Euro lighting for the touring.
sorry, for the long post, but there is very little info on this on any forum for these codes. just hoping to help somebody in the future.