From investopedia: "YTM is the total return anticipated on a bond if the bond is held until it matures"

I have also seen this interpretation used in other sources however this seems wrong to me.

More specifically the I don't see how the anticipated rate of return can be independent from the cost of capital. 

What I get from the math is that YTM expresses the cost of capital required for the net present value to be zero.

If the YTM is low then I can probably use a higher discount rate when calculating the present value of the bond. But using a higher discount rate than the YTM, by it's definition means a lower present value and therefore a negative net present value.

If the YTM is high enough then I will most likely use a lower discount rate, meaning a higher present value and therefore a positive net present value.

Is my understanding correct?