You are correct. If company X makes a profit of 100 and company Z loses 50 then a person owning both companies would be worse off than if he only owned company X.
He also doesn't get to offset the total loss of 50 in his tax return only the taxable value. So say he is due to pay 35% on his 100 profit i.e 35 he would be able to offset his loss of 50 x.35 = 17.50 giving a final tax calculation of 35 - 17.5 meaning he would pay only 17.5 instead of 35.
So
If he had one company that made 100 profit, after tax he would make 65 net.
If he owned to companies, one making 100 and one losing 50 he would make 32.50 net
Also worth considering that if a person owns two companies then they must be declared in the eyes of the taxman as being a part of a holding group or that a single person owns both.