We certainly do not assume that the cost of debt is zero!! It is given in the question as being 4.5% and this is what has been used in the answer.
What you may be confusing it with is the when we use the asset beta formula, we always assume that the beta of debt is zero. I do explain this in my free lectures on CAPM.