Improved phase correction behavior in as_pauli_operation