Here's how you need to picture this play. A force is a force, no matter if it's a ball being carried or fumbled. What happens if A carries the ball out of the EZ, then returns? Momentum is cancelled. Same thing happens if his fumble (also a force) goes out of the EZ then returns without a new force imparted on it. Using 8-5-2b's wording, B's fumble forced the loose ball out of the EZ, and the same force was responsible for it returning "from the field of play to or across his goal line." Safety. Just picture him "carrying" the fumble, and it will lead you to the right result.
As said before, the momentum exception only applies to 8-5-2a. The reason that a fumble out of the back of the EZ, or a fumble that stays in the EZ that's recovered by B, still results in a momentum exception is because the requirements of 8-5-2b are not met to make it a safety. 8-5-2b requires the loose ball to cross "from the field of play to or across the goal line," and that doesn't happen in that case. Remember, the definition of force states that force only applies in one direction, from the field of play into the EZ.