In your situation : no. Trash it. Without getting into specifics it was probably part of the replacement agreement you may or may not realize you entered into with the OEM
reality: fix it. Then you have a backup. Keep it on the trainer. Have it as a backup for when you crash yours. Donate it to a local team for juniors, etc. disclose that it was repaired.
I was hoping the question would be more about whether it’s OK to sell a repaired frame. That one is an easy yes as long as you disclose the repair.
In this case whether or not you have the actual right to re-sell it I would argue that ethically you do not. The replacement frame from the company wasn’t free. When they gave it to you morally the old one is now theirs. Instead of paying to ship it back most companies rely on the local shop handling the warranty to destroy the frame. Guessing it was a smaller company or you somehow acted as your own dealer.