AFM is an electrical device and it sits in the hot engine bay day in day out.
get's hot, then cools, then hot then cool.. for how many years?
it is common for the AFM plug to get brittle with all that heat.
it is also pretty common for them to get dry Solder joints within the AFM.
so they can play up.
makes it even worse if the AFM is attached to a pod which is not braced against something..
so.. if you do a search for the words SOLDER+AFM, you will come across a thread that talks about this and instructions on how to fix it.
however, if I were you, I'd get myself a factory airbox and filter, fit it and test it out.