Shylock is trapped within the legal system and various laws which put him in a bind. At one moment, he is ready to extract his pound of flesh, the next it is his life which is hanging in the balance. First he is told that if he spills the blood of a Venetian,
“land and goods/ Are by the laws of Venice confiscate/ Unto the state of Venice” (ll. 309-311).
Shylock would rather die then lose his material properties, so the Duke works out a compromise with Antonio and Shylock. The laws of Venice do allow it, but one should keep in mind that it takes several different laws, with special interpretations, to trap Shylock.