Box Extent not correct 5.1.1

You wrote in your initial post that you use scaled cubes, the first screenshot probably shows the correct OBB for the unscaled cube. You have to multiply Min/Max with that scale before doing any of the other calculations.