The negative value may be correct.
Stock A a positive expected return, B has a 0% expected return, and the risk free rate is 0%. A and B are perfectly negatively correlated and have the same standard deviation. In this case, you could buy equal amounts of the two stocks and earn a risk-less return in excess of the risk free rate. By contradiction, the sum of the expected excess returns of two perfectly negatively correlated stocks with the same standard deviation must be zero.
If you have a factor model which produces large positive and negative cost of equity values, your model may be over-fit or you data could be corrupted.
Overriding the negatives with zero is unlikely to be a correct solution because it would make the portfolio expected return look unrealistically attractive. It would appear as if a long only portfolio could offset the factor risks without offsetting the expected returns.