Okay. If the engine runs fine until it gets warm, these two codes make sense. You are correct they are for the MAF and Ambient temp sensor.
To properly diagnose these codes, you need to test wiring, power, ground, and then the sensor.
If it were me, I would just replace both sensors. You are able to clean these but again, I would replace them and then clean the old ones in the event they ever fail again, you can try to swap them out.
Here is guide on how to clean the MAF. The ambient temp is done the same way.
I did attached a quick voltage check for the MAF. So if you want to check the voltage first that would be how to do it and what you should be seeing.
As for your issue, this would explain why your vehicle is running fine until it is warmed up. When the vehicle is warming up it is running off of a predetermined set of numbers. Once it is warm it starts reading the sensors and if they are wrong then it will cause the vehicle to run poorly.
https://www.2carpros.com/articles/mass-air-flow-service
Image (Click to make bigger)
Thursday, January 7th, 2021 AT 1:27 PM
(Merged)