Certain impassable walls like Wall of Stone can be formed on the same square a creature occupies to force it make a Ref save vs entrapment. A successful save puts them on the side of the wall of their choosing. This is only for direct attacks for the wall, you can have a wall rise up on all the squares around them without a problem, no save.

Then use a second casting to fill the enclosed space with a second wall of stone. They can't go anywhere to get out, so they should not be allowed a Ref save. Instant suck.