Plato is trying to mark a distinction between the Laws themselves and the legislators, one of his reasons for trying to embody the Laws in a voice distinct from any particular person or people. But if we unpack Plato's argument, it seems that there must be a contradiction somewhere. To review: Socrates is imprisoned either justly or unjustly. If he is imprisoned justly, that means he has done wrong and deserves to be punished, a claim that Plato would never want to make. Therefore, he is imprisoned unjustly. If he is imprisoned unjustly, he is being wronged either by the Laws or by the people. Again, it is clear that Plato wants to argue that he is being wronged by the people. Now if the people are wronging Socrates unjustly, that means that they are wronging him in a way that is not in accordance with the Laws. Thus, Socrates should not be breaking the Laws in trying to break free from prison.
The only possible answer is a rather tyrannical one, that the Laws are good and are created for good purposes, but must be obeyed no matter what, and it is up to the people to carry that out. The laws against corrupting the young and preaching false deities are just, and if one is found guilty, one ought to be punished. The problem is that the people have not carried out the application of these laws in a just manner by condemning Socrates. Nonetheless, trial by jury is a part of the Laws; the Laws are inflexible, and if Socrates is found guilty by jury then he is guilty according to the Laws. This picture of the Laws, however, does not seem as just or as reasonable as one might like.