Does word "loss" have the same meaning in the following two sentences?

It was written off as a loss.

Everyone expected him to win so his loss was a shock.
different meanings