The Apple business model is the opposite to that of Microsoft.
Purchases are tied to you & your Apple ID, not to the machine they run on.
This makes migrating to a new machine very simple, but juggling purchases across multiple IDs difficult. Apple doesn't want you setting up multiple IDs just on a whim, it wants one user tied to one ID.
Once you start juggling IDs, you will find that each time you need to update anything, you will need to logout of your current ID & log back in with the one used for that particular purchase.
Either that or set up Family Sharing with all your IDs as the members of the 'family'.