严正 is formal and primarily diplomatic / official-statement vocabulary. The phrase
严正抗议 ('stern protest') and
严正声明 ('solemn declaration') are extremely common in Chinese government communiqués. Don't use it for everyday strictness - use
严肃 (yánsù) instead.