After analyzing the criminal procedural rules governing the procedure for simultaneous rendering of a sentence and making an appeal against measures of restraint, and studying the law enforcement practice, the author concludes that persons sentenced to real deprivation of liberty and taken into custody in the courtroom are significantly limited in the possibility of implementation right to judicial protection. Since the decision on the measure of restraint, initially of an interim nature, becomes an integral part of the verdict as a final court decision, it is impossible to challenge detention in the form of an urgent appeal. The relationship with the sentence regarding the decision on punishment does not make it possible to reconsider the decision on the measure of restraint on its own, separately from the sentence. However, contrary to the principle of the presumption of innocence, this circumstance does not interfere with the law enforcement authorities to immediately enforce the verdict in terms of decisions on the measure of restraint, and, therefore, on the corresponding punishment, which is permissible only in relation to interim decisions. At the same time, the general procedure for appealing against a sentence and the possibility for a convicted person to apply for cancellation of a preventive measure are not effective legal remedies. Interpreting this as a violation of the principle of legal certainty, the author concludes that it is necessary to eliminate doubts that the decision on the measure of restraint cannot be part of the sentence, and suggests amending the criminal procedure legislation accordingly. The problem, which implies the need to ensure the possibility of an urgent appeal against the decision on a custody, will be resolved by itself.