Where and how did you buy the app? When getting the app through an App Store, it is not possible to buy it twice for the same platform with the same account. You can read more about it here.
For the Microsoft Store, the payment is processed by Microsoft. I have no insights into it. If the payment is indeed showing up twice in your Microsoft account payment history, this would be a critical bug on Microsofts side - let me know if that is actually the case and I try to file a bug report