The large-scale integration of intermittent distributed energy resources has led to increased uncertainty in the planning and operation of distribution networks. The optimal flexibility dispatch is a recently introduced, power flow-based method that a distribution system operator can use to effectively determine the amount of flexibility it needs to procure from the controllable resources available on the demand side. However, the drawback of this method is that the optimal flexibility dispatch is inexact due to the relaxation error inherent in the second-order cone formulation. In this paper we propose a novel bi-level optimization problem, where the upper level problem seeks to minimize the relaxation error and the lower level solves the earlier introduced convex second-order cone optimal flexibility dispatch (SOC-OFD) problem. To make the problem tractable, we introduce an innovative reformulation to recast the bi-level problem as a non-linear, single level optimization problem which results in no loss of accuracy. We subsequently investigate the sensitivity of the optimal flexibility schedules and the locational flexibility prices with respect to uncertainty in load forecast and flexibility ranges of the demand response providers which are input parameters to the problem. The sensitivity analysis is performed based on the perturbed Karush-Kuhn-Tucker (KKT) conditions. We investigate the feasibility and scalability of the proposed method in three case studies of standardized 9-bus, 30-bus, and 300-bus test systems. Simulation results in terms of local flexibility prices are interpreted in economic terms and show the effectiveness of the proposed approach.