For password recovery on Catalyst 9300, look at this:
https://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst9300/software/release/16-6/configuration_guide/sys_mgmt/b_166_sys_mgmt_9300_cg/b_166_sys_mgmt_9300_cg_chapter_01100.html#task_nzq_q4z_n1...
Your answer is wrong. The correct way to password recover a Catalyst 9300 is here:
https://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst9300/software/release/16-6/configuration_guide/sys_mgmt/b_166_sys_mgmt_9300_cg/b_166_sys_mgmt_9300_cg_chap...
Your solution was correct, but lacking sufficient detail for people who don't work with ESA and SMA everyday. I'm going to elaborate on your process.
First, delete any existing host keys on SMA:
-----------------------------------------------
Curre...