Back to basics... You have changed the MAF, and thermostat, so next obvious steps are:
1. Disconnect and check the entire induction tube from the MAF body to the throttle body for leaks and splits, no matter how small... Easiest way to do this is to seal the ends with latex inspection gloves and secure with elastic bands to make it air tight... Now test it in a bath of water and hold down for a couple of minutes while checking for escaping bubbles.
Visual checks only can lead to missing hairline leaks between the rubber that open up on engine movement... Replace the original spring clips with quality stainless jubilee clips.
2. While the induction tube is removed... Now is the ideal time to clean out the throttle body and butterfly valve of carbon, oil and grit deposits with carburettor cleaner spray... Plenty of tutorials that offer safe advice on how to do this with fly by wire TB's.
3. Make sure your Air box lid is sealed properly... Rich unfiltered air then metered, filtered air as you drive along.
4. Make sure your MAF is sealed onto its housing properly. Bypassing the maf sensor itself due to lack of a rubber seal and loose security screws if it was just the sensor replaced in the original body.
5 Check the breather pipes are not blocked or restricted with oil deposits... It is normal to have light deposits but if the internal diameter of the pipes are below half what they should be, then it will cause a constant air quality and quantity variation that has a bearing on the TB mixture position settings.
6... You mention the difficulty revving above 3,000 rpm when this fault occurs?
That would either be safe mode or the MAF... Even though it was new, was the air box dirty and contaminated at the bottom or was it vacuumed out and a new filter fitted at the same time?
7.It could be contaminated/ or even the MAF multiplug connector giving intermittent contact if it was mistreated during removal....
8. Disconnect the fuel injector plugs and refit them securely, giving them a tug to make sure the spring clip is seated firmly... Believe me, even I missed this simple thing once and it gave me wierd and wonderful readings and issues for something so easy to forget... I had one plug that was making ever so slight contact and was throwing everything out of wack.
All these things can give symptoms and readings you have described
Hope this helps