To answer this question properly, I would more or less have to repeat your steps, to see what I get. As you might guess, that would take a little time.
But I have a recollection of having seem remnants of SQL 2017 on a server which originally ran SQL 2017 and then gone through in-place upgrade to SQL 2019 and SQL 2022. I think I concluded that is share components. I don't recall if we uninstalled the old stuff.
I would assume it's safe to uninstall, but I am not fully confident. If this is a VM, take a snapshot of the VM so that you easily can roll back if things go south.