UPI exposes a bank account. If $hit happens in a payment, the entire bank balance can get wiped out. Not to single out UPI, this vulnerability is common to all bank account linked payment methods including Zelle (USA), FPS (UK), NEFT (India), which are also known as Account-to-Account (A2) payments.

The exposure in the case of a Digital Wallet is limited to the typically small amount of money kept in the digital wallet.

So, digital wallet is safer than UPI.

If you don’t have a credit card and have no choice but to use UPI, then I strongly recommend that you link it to a bank account that’s ringfenced for UPI payments by keeping a small sum of money. In other words, treat that bank account like a digital wallet!