King Charles III praised the nation and Commonwealth for how communities reacted to anti-immigration riots earlier in the year.