Here a possible fix.
decimal weightFreeShipping = decimal.Zero;
foreach (var packageItem in getShippingOptionRequest.Items)
{
if (packageItem.ShoppingCartItem.IsFreeShipping)
{
weightFreeShipping += _shippingService.GetShoppingCartItemWeight(packageItem.ShoppingCartItem) * packageItem.GetQuantity();
continue;
}
//TODO we should use getShippingOptionRequest.Items.GetQuantity() method to get subtotal
subTotal += _priceCalculationService.GetSubTotal(packageItem.ShoppingCartItem);
}
//items with free shipping should not be considerated in weight calculation
var weight = Math.Max(_shippingService.GetTotalWeight(getShippingOptionRequest) - weightFreeShipping, decimal.Zero);