While Reserve Bank India has ruled that NRIs can user UPI and that too with their foreign phone number, in reality I have not come across a single bank offering this service with NRE accounts or with foreign numbers.
The best way for NRIs to user UPI when they are in India is to basically get an Indian sim card and and Indian bank account. The best would be to get an NRO bank account instead of NRE account for this purpose.
Most Indian banks do no support simple online bank account opening process. Instead, you have to visit the branch for opening NRO or NRE accounts along with your passport and other details.
Another way you can make payments in India is by asking your friends or parents to open a bank account for this purpose and link your phone number to it. However, there are always legal and financial risks for the person opening the account.
I have personally found Yes Bank and HDFC Bank to be the best banks in India and Gpay to be the best UPI app for all purposes.