Had a problem that appear to be similar to yours. My 2007 Sonata started as new having the idea of not wanting to rev or ignite, after a while it seemed to reconsider. One day I had to try for over half an hour so I took it to the local dealer, who checked the error codes. As it turned out the code ring in the lock had broken.
Sincerely Daisy