The housebuilder swung to a loss largely due to a rise in the cost of cladding fixes as its sales rate dropped.