HELP, Something went wrong ?! IDK what to do...(Code 16)

Okay, So breif back ground.
B20 Turbo Stock internals.
.57trim on 11 psi.
also using a walbro 255
Not running aftermarket coil or anything...
car is tuned.
So I was sittin in my car eatin lunch, I had a short one so I just ate inside, and let the car idle so I could listen to the radio.
Then it felt rough, my AFR gauge showed it goin lean, 16-17 for a few secs. I hit the gas cuz headlights were dimming... and it went back to normal.. it did this 2 times...
So I go to get a hair cut, let the car warm up for about 5-10 mins before i left the parking lot...
did one short pull in second gear to get up to speedlimit...
when I left the hair cut place. my car was idling really rough and wouldnt show AFRs at all.. it was super lean... I drove it like a granny cuz I dont wanna blow it.. and all of a sudden it goes back to normal like nothing happened, but the check engine light did pop... havent checked it yet...
drove it for a bit, stopped at the store on the way home... and then turned it back on and it did the same thing, check engine light was off to start off, but then all ove a sudded everything happened again and it came back one...
I checked all lines, everything was connected.
no leakes, good on oil. good on everything.
where can I start to see whats goin on?
Can someone help?
Will disconnecting the battery make me lose my tune?

B20 Turbo Stock internals.
.57trim on 11 psi.
also using a walbro 255
Not running aftermarket coil or anything...
car is tuned.
So I was sittin in my car eatin lunch, I had a short one so I just ate inside, and let the car idle so I could listen to the radio.
Then it felt rough, my AFR gauge showed it goin lean, 16-17 for a few secs. I hit the gas cuz headlights were dimming... and it went back to normal.. it did this 2 times...
So I go to get a hair cut, let the car warm up for about 5-10 mins before i left the parking lot...
did one short pull in second gear to get up to speedlimit...
when I left the hair cut place. my car was idling really rough and wouldnt show AFRs at all.. it was super lean... I drove it like a granny cuz I dont wanna blow it.. and all of a sudden it goes back to normal like nothing happened, but the check engine light did pop... havent checked it yet...
drove it for a bit, stopped at the store on the way home... and then turned it back on and it did the same thing, check engine light was off to start off, but then all ove a sudded everything happened again and it came back one...
I checked all lines, everything was connected.
no leakes, good on oil. good on everything.
where can I start to see whats goin on?
Can someone help?
Will disconnecting the battery make me lose my tune?
