When a Cannon Cart is on Last Stand, if there are no Guard Post units or buildings that it can target besides Walls, it will do nothing. I think it should at least target some Wall instead of standing still, preferably one that encloses a compartment and is low on Hitpoints. It serves two things:

1) More Walls destroyed for stuff like Clan Games/Season Challenges. It might not make a big difference but everything counts.
2) Can help for multi stage ground attacks (example, maybe you saved some Raged Barbarians to attack later and that Cannon Cart opened a Wall that helps them target a building faster, without having to break through the Wall which might be risky as fire from defenses could weaken them a lot).

If there is no Wall that surrounds a compartment, then it should target a random Wall instead, just to help for the first purpose and alter pathing a bit.