Before buying a new/old one, try taking the top off and cleaning the contacts

or borrow a known good one.
Also, the correct procedure when changing an AFM or ECU, is to callibrate them to each other.
I know most people don't do this but the correct way is as follows.
Change the fuel type relay for one that is the same ron but without lambda correction.
This will allow adjustment of the idle mix, if you have a dongle that uses lambda correction any adjustments on this screw will be ignored.
You then adjust the idle screw on the AFM until you get a CO2 reading between 0.6 - 1.0 before the cat.
I borrow the correct alfa tool that goes in the 13mm bolt hole by the O2 sensor.
When done replace the correct fuel selector dongle and bobs yr cross dressing aunty.