When you draw a rectangle, it is created as polyline to keep a relation between the entities.
If you want to trim the rectangle, you have to use Modify -> Explode first, to separate the lines again, before trimming.
investing less than half an hour into Search function can save hours or days of waiting for a solution