The Ufile is correct in terms of applying the tax rules. The rule applies if you realize a capital gain on the sale of the land and a terminal loss on the sale of the building. Only half of the capital gain is included in income. In contrast, the entire amount of a terminal loss is normally deductible in full. In general terms, a terminal loss on the sale of a building occurs when you sell the building for proceeds that are less than the undepreciated capital cost (UCC) of the building.
Basically, in your case, 100% of the loss from the sale of building (land should be calculated separately) is deductible.