Two companies have been fined after a worker fell more than three metres through the second floor of a building.