Here is the twist: multiplying two negatives gives a positive. So the most negative product at position might become the most positive at position . Consider . The product of all three is , which is positive.
But If only tracked the maximum product ending at each position, you would miss this. At index , the max product ending there is (just the element itself). You would discard the . But that is critical for the final answer.
Why a simple Kadane-style approach fails. You cannot track the maximum. negative products too, because they might become positive later. Zero is another edge case. Any subarray containing zero has product zero. So zero acts as a "reset point". You must start fresh after it.