Yes, it's recommended, as said in below official docs:
> Uninstall all site system roles from the site and the site server. For more information, see Uninstall site system roles. While this preparation step isn't required, it helps identify any additional dependencies before uninstalling the site.
reference link:
https://learn.microsoft.com/en-us/mem/configmgr/core/servers/deploy/install/uninstall-sites-and-hierarchies#bkmk_pri-plan