So let's clarify what you are supposed to do
1. Change the version in Dev, via Settings
2. Publish all customizations
3. Export both an unmanaged and managed solution
4. Import managed into Test
5. Cycle and repeat while you fix stuff
6. If you are using a pipeline go from Test (aka SIT) to UAT for user acceptance
7. Pipeline from UAT to production or use the same managed solution in all
Make sure you are using Environment variables (never name anything - Dev or Prod etc) if you want to identify the environment Type it is (DIT/SIT/UAT/PERF/PROD)
Now as to cleaning up... honestly I am following what you said, but you SHOULD start over.
But that being said you are creating multiple versions of these things and is why Dev is not going away, you are not really updating the Agent that you want. If you were it would go away (the word Dev)
If I were you...
I would create an Unmanaged Solution in Prod.. put the thing you WANT in it. Export it
Delete anything else in DEV NOT PROD
Import that
Fix what you want
In Production, you WILL have to delete the stuff you have, but thats ok you are about to put it back
Delete any unmanaged and managed solutions with your Agents
Import your new Managed Solution, which is coming full Circle from Prod back to Dev back to Prod
I have to fix this for people all the time.
If these suggestions help resolve your issue, Please consider Marking the answer as such and also maybe a like.
Thank you!
Sincerely, Michael Gernaey