So the Marauder’s unique “Have We Ever Followed Orders” says Marauder cannot be stunned if the allied capital ship is destroyed. However, if Marauder is stunned with a capital ship, it will remain stunned after the capital ship is destroyed as shown in the picture below.
The best fix that comes to mind would just be to dispel stun, including the un-dispelable stun, when the ability is triggered.