Here is what I suspect. When the lid was left loose, the cars mass air flow sensor is left exposed. The computer will do what it can to offset the readings and give you the best possible fuel mixture.
Now it created what is called a long term fuel trim. Once you got the lid tight, the fuel trim is off enough to make the car run worse. It is also possible that the air filter itself isn't allowing enough air into the system and the car is suffocating.
What I would try first is to unplug the mass air flow sensor and see if the car runs any better, if it does, the sensor itself may be damaged. If not, then I would try if possible to get the codes read and cleard.
Basically trying to reset the fuel trim back to zero so it can create a new fuel trim to run on.
IF this has anything to do with the oil change and the air filter, this would be what would have happened.
Please let me know what more I can do to assist you today. Also, please remember to rate my answer, Just Answer does not compensate me for my time and resources. Follow up questions are included in the price of your question. If you are using the free trial, or have a subscription a rating is still required.
Thank you so much!