Why is that, sometimes iPad charges on 12W charger and then not.
I bought the iPad air back in 2013 or 14 and the charger i am using it is which came with the box.
So if I understand correctly, your iPad will charge when you use a 5W USB Power Adapter, but not the 12? If that is the case, then I would think that there is something wrong with the 12W charger.
I’m also leaning towards an issue with the iPad brick.
If the brick has been dropped, hit, slammed, etc., it could develop an intermittent issue. Most likely it's either good or bad, but there can be exceptions.
Can you charge anything else with the same brick, and if so, do you get the same result?