ZURICH—Switzerland’s central bank on Friday posted its heaviest ever annual loss in 2015, a byproduct of the bank’s decision one year ago to scrap a long-standing policy aimed at keeping the overvalued Swiss franc in check.

The 23 billion Swiss franc loss ($23.05 billion) highlights the challenges facing central bankers in Switzerland and elsewhere who are trying to prop up their economies and guard against deflation risks by purchasing bonds and other assets or intervening in currency markets.

...