Yes, unless the doctor had a proper "Merchant" account, I think you cannot use the credit card to pay to that UPI / QR code.
I have been using PNB credit card on UPI for some time, it works in most shops, but once I had to pay a plumber, he likely just had a savings account UPI QR that he shared, and I could pay to it only from one of my bank accounts. This happened in another small snacks shop too.