I recently decided to clean my 2006 G35 coupe (6MT) intake air filter (reusable K&N filter I have used for several years). Upon removing the hose from the filter housing, I noticed the rubber hose leading to the throttle valve was ripped just next to the metal ring that Fastens the rubber hose to the throttle valve (A common problem), so cleaned the throttle value and opening below and above the throttle value (when in the open position) as there was gunk n the valve and on the actual throttle body using a spray from Walmart which said it was intended to clean the intake and carburetor. I clean the throttle body value and surrounding area, replaced the ripped hose, and cleaned the air filter. I noticed the car RPM at rest was around 1100 versus ~600-700 before doing any of the work. I did the reset/learn using the ingestion and gas pedal and the RPM dropped to 600. The next time I started the car I noticed the idle rpm was high again around 1100. Eventually the rpm dropped t0 600 after driving the car a few more times. After a few days the check engine light come one and got a code P0507. Any suggestions on what may have caused this error code to appear? There is no leak in the air intake line and the throttle body valve and surrounding area are clean as I had just cleaned them up. Another issue I noticed is that when I try to accelerate hard in 5th or 6th gear the car will reach ~4000rpm then drop by ~500 while my foot is on the gas the entire time. Also I noticed the rpm sometimes dropped very rapid/y by a few hundred rpm when removing my foot off the gas pedal vs dropping gradually.
Any insight or advice would be very helpful.