The plastic cover to the AFM has a lip that sits well down inside the walls of the AFM. Maybe 1/4" ?
Just use an Exacto and see if you can cut through the seal around it, where it meets the casting. Likely it has been done before, and may have an easy to cut RTV sealant. I use standard white house caulking (Home Depot - Alex Plus) to reseal mine, and it is easy to cut through that later on if needed. Pry up one little bit at a time, going around the cover, and it will eventually let loose. The cover is actually made of pretty strong plastic, but we don't need to be breaking this thing.
Pete
'80 FI Spider 2000
'74 and '79 X1/9 (past)
'75 BMW R75/6
2011 Chevy Malibu (daily driver)
2010 Chevy Silverado 2500HD Ext Cab 4WD/STD BED
2002 Edgewater 175CC 80HP 4-Stroke Yamaha
2003 Jaguar XK8
2003 Jaguar XKR
2021 Jayco 22RB
2019 Bianchi Torino Bicycle
I don't think the AFM switch is the issue. To check it simply disconnect the AFM connector. The dual relay's "control relay" has to be engaged for power to reach the fuel pump switch in the AFM. The control relay should only be powered in the "start or run" positions of the ignition switch. If the ignition switch is "off" there should be no voltage going to the fuel pump switch in the AFM. Once the "control relay" is engaged voltage is fed to the AFM fuel pump switch to engage the "fuel pump relay" in the dual relay. I would inspect the ignition switch connector and dual relay area.