In the case of an inadvertent benefit overpayment from a plan to which section 414(aa)(1) applies that is transferred to an eligible retirement plan by or on behalf of a participant or beneficiary—
(A)#
the portion of such overpayment with respect to which recoupment is not sought on behalf of the plan shall be treated as having been paid in an eligible rollover distribution if the payment would have been an eligible rollover distribution but for being an overpayment, and
(B)#
the portion of such overpayment with respect to which recoupment is sought on behalf of the plan shall be permitted to be returned to such plan and in such case shall be treated as an eligible rollover distribution transferred to such plan by the participant or beneficiary who received such overpayment (and the plans making and receiving such transfer shall be treated as permitting such transfer).