I haven't been able to figure this one out and I've only seen one other person complain with similar symptoms (their noise occurred at 2k rpm area), who unfortunately didn't follow up with the solution, so I'm throwing this out there and will update with any results. Currently have an 07 auto 1ZZ that makes a rattling or clicking noise only while moving between 2900-3300 rpm in every gear, even while decelerating back through rpm range without giving it gas. However, I cannot reproduce it standing still out of gear so I can't locate the source of the noise. The car does have P0012 and P0420 codes and does have excessive exhaust odor, but otherwise runs very well. I've already checked heat shields, replaced VVT solenoid and cleaned the screen, and replaced the timing chain tensioner. I'm trying to rule everything else out before blaming a bad actuator or timing chain because it doesn't appear to have the typical symptoms of those, as I understand them to be (loud startup, louder at low rpm and rough idle). Noise persists without the serpentine belt connected. Perhaps the noise could be from a bad catalytic converter but i wouldn't expect the noise would be only in the 3000 rpm range. I've seen a few posts that early 1ZZ engines would develop a loose baffle in the intake manifold, but other than blindly inserting screws into the manifold to secure the baffle, I don't know how to test it. Tried linking video below.
https://youtube.com/shorts/KiqGwCILslw?feature=shared