Scenario 2: Case 2

Suppose state N has already been removed from the priority queue and another state is about to be removed and expanded: