The problem I've read is that a game can just skirt around this by not adding lootboxes, but instead adding a "chance" mechanism that works roughly the same way, but is hidden under several deeper layers of game design.
Also, I remember a ruling by the UK gambling commision (I think?) that said lootboxes are NOT gambling, because there are no monetary rewards you can obtain from them.