Please don't list this on a work's page as a trope. Examples can go on the work's YMMV tab.
Tear Jerker: Bolo
There are a hell of a lot of Last Stands, but one of the most heartbreaking is in David Weber's "Miles to Go" in the third book. "A Relic of War" is good for quite a few tissues as well.
Laumer's own "The Last Command," when a junked Bolo accidentally reactivates, thinking the enemy has taken the planet — "only the memory of my comrades drives me on" — and then recognizes its now-elderly human commander.
"The Traitor" has a Bolo hunt down another that, apparently, turned on its comrades. Only when the "traitor" offloads passengers—orphaned children it had saved—does the other realize the truth: the other Bolo has been damaged and thinks anything armed is the enemy. The hunting Bolo still has to kill the damaged Bolo, asking forgiveness from its brother while doing so, while one of the orphaned children weeps and futilely tries to convince the latter to see that he's attacking a comrade.
Made sadder toward the end when the Bolo's madness has degraded to the point of shrieking a Madness Mantra about destroying the enemy even as said "enemy" solemnly asks for its forgiveness before delivering the Mercy Kill.