When you find yourself trying to remember a show (or any works) that's on the tip of your tongue but just out of reach, come here - the collective brain of the TVTropes community can probably help. Post all the details you can remember (examples help). If you're looking for a trope, head over to Trope Finder. Have general questions about tropes? Visit Ask The Tropers!
Given the timeframe, it would have to be something related to the original Marvel comics.
The closest thing to what you're describing is probably the storyline "Prey" from the UK run of comics. The context is a bit different, but it does end with the Autobots finding Optimus's remains after he ends up in a fight with Megatron.
I'm trying to find a specific issue/storyline of the Transformers. When I was young, in the 90s, I read a comic with an image that burned into my mind: Megatron holding another transformer, who is Optimus Prime my memory, by the innards of his chest. The transformer (Prime) is exceedingly damaged with its "guts" in Megatron's hand, while Megatron says "He's finished." Then a few car transformers show up with the dialogue "it's our party now!" and the comic ends with one of them seeing Prime dead/damaged and says "Optimus?"
Any help would be appreciated, but since this is a single issue of a long-running series with multiple comic lines and adaptations, I won't be surprised if no one knows this one. Not to mention it happened so long ago that my memory might be conflating different things into one memory that aren't real. Can't hurt to ask, though!