Carrefour has swung to a first-half loss and cut its forecast for annual profits after half-year earnings were hit by a poor domestic performance and a number of one-off items.