Confidence doesn't come from the certainty of success.
It comes from accepting that things might not work out the way you want, but giving it your best shot anyway.
It comes from the knowledge that you can cope with whatever happens, even if you know it will be difficult.
It has to be this way. If confidence only came from certainty of the outcome, then you would never be able to take risks or do anything new.
A PhD is all about uncertainty. You don't know what the end result will be. You don't know if your research will work and you don't know what others will think of it. And the more interesting and challenging and novel the project, the greater the risk.
Focusing on the uncertainty distracts your attention from the work in front of you, which in turn makes it more likely that things will go wrong (reinforcing your doubt).
Accept the uncertainty. Accept the risk. Trust in your ability to cope with whatever happens.