The tank vents through the cannister, which catches the fumes. There's a solenoid on top of the cannister which connects to a pipe that runs to the manifold. Under certain conditions (manifold vacuum and certain RPM range), the solenoid opens. Manifold vacuum pulls air through the charcoal and brings the vapours into the engine to be burned. Under boost, the solenoid is closed but there is also a check valve in the pipe near the manifold to stop boost getting to the cannister. When pulling vapour from the cannister, this will cause the mixture to become more rich. I'm not sure if there is anything specific in the code to pull fuel or whether it just relies on the O2 sensor but If something is not right here, it could be messing with your fueling. You could cap it temporarily to see if it changes the behaviour. It could be that if your solenoid isn't opening, the cannister is saturated and allowing fumes through.
Unfortunately, I don't know enough about the system to say for certain which conditions cause which symptoms other than it sounds like your engine may be stalling because it's going lean.