You yourself have not figured out a concept, which is the relationship between "UnionPay" and "master/visa".
These are all clearing systems. UnionPay settles in RMB, and visa/master settles in foreign currencies. In other words, your credit card can only be VISA UnionPay, MASTER UnionPay, or a "UnionPay" card starting with 62.
Most of the credit cards issued in mainland China, VISA/MASTER, are US dollar cards, but there are also some Euro and Hong Kong dollar cards. If you use VISA or MASTER while traveling in Hong Kong, there will be at least two exchange rate losses, plus currency conversion fees - when you pay, it is converted from Hong Kong dollars to US dollars, and when you repay, you have to buy in RMB Foreign exchange is quite uneconomical.
If you use UnionPay, it will be converted directly according to the exchange rate of the day. When repaying the loan, you can just pay it back in RMB. This is the simplest and most convenient way.
In other words, you need to tell the cashier to use "Union Pay" when checking out.