The straight answer is you can not cancel a pending UPI transaction on Phonepe once it is done. The amount is already debited from your account and kept on an intermediate medium, and then transferred to the said account when scheduled. Only if the transaction has failed, you get back your amount to your account.