This issue occurs since you can only set a default package in Shopify for all products. One of the workarounds for this issue is to set the largest box as the default option so that, all the orders goes in that box. But as you might have faced, the problem with using default box size is that you will be undercharging or undercharging shipping cost for some orders.
Since you have multiple package sizes you ship with, you would need a shipping app like our Multi Carrier Shipping Label app that helps you set up different packages for your products based on the weight & dimensions. So, whenever your customer places an order, the app automatically chooses the right box and calculates the rates accordingly.