Game companies also game the system. They add these mechanics after the game goes to reviewers, so it’s not mentioned in day-one reviews and the ESRB doesn’t require re-rating when they are added.
Further, even if they did, that doesn’t change the rating on the box at point of purchase or after purchase.
Realistically, the only way to allow this is either for video game platform holders (Sony, Microsoft, Nintendo, Google for Android, Apple for iOS, etc) to have a standard way for these sorts of gambleboxes to be purchased such that parental controls can be used console wide to either set spending limits or disable the ability to spend at all or for the government to make the publishers accountable for it.
Some platforms have already moved here, but the response industry-wide had been anemic at best.