How to anticipate a collision

My game objects all move randomly in one of 4 directions (left, right, up, down). When they hit a collision polygon that defines the boundaries, they change direction (by choosing from the 3 directions other than the current one). This works fine, unless the part of the poly they hit is oblique - in some cases, the new direction takes them further into the no-go area.

For example, if my collision poly goes from top right to bottom left, and my game object is moving up and hits it, the new direction is sometimes left which still takes it into the collider.

Is there a way to determine if a move in a certain direction will cause it to keep colliding with that same object, so I can eliminate two possibilities from the new direction?

Are you using the PhysX engine, or just writing your own collision/response code? I mean, these type of problems are what physics engines are specifically designed to address. To re-write things from scratch, while educational, would be costly.