It looks like that example image of the rotated rectangle is already trimmed as far as it is ever going to be trimmed. You’re done.
Trim does not exactly “remove all transparent pixels.” Trim removes all edge pixels that have the exact same color value (which can be transparent, as long as they are ALL transparent). AND, which is probably being missed here, it trims to the smallest
rectangle that contains the shape. You already have that. It is not possible to trim to a smaller rectangle without trimming the magenta parts of the shape, so there is nothing for Trim to do here.
The real function of trim is to remove uniformly colored (or uniformly transparent) space outside one or more sides of non-transparent pixels. What you are showing does not show anything left to trim. Every side has at least some non-opaque pixels that already touch that side. That means on every side, pixels are not the same value all the way across that side, so Trim will not trim any further.
It seems like what you want is to end up with a non-rectangular shape. If so…you cannot do that. An image, especially an image in a standard format like PNG or JPEG or TIFF, must always be a rectangle.
If your goal is that you want that to appear as “not a rectangle” (no opaque background, irregular shape) as a layer or as an imported graphic in another application, what you have shown is already going to do that. The transparent pixels are doing that job. When that graphic is layered over something else in an application that properly handles transparency, it is going to look like that shape, and not a rectangle. Because the transparent parts all drop out, so it will effectively not look like a rectangle.
it would be nice to have an option that trims whatever it takes to remove all transparent pixels.
The transparent pixels already represent “nothing there”, the smallest possible
rectangle containing the non-opaque shape has already been achieved, so the removal you want is already as complete as it is ever going to get with the standard image file formats we have today.