Non-linear Mendelian randomization is an extension to standard Mendelian randomization to explore the shape of the causal relationship between an exposure and outcome using an instrumental variable. A stratification approach to non-linear Mendelian randomization divides the population into strata and calculates separate instrumental variable estimates in each stratum. However, the standard implementation of stratification, referred to as the residual method, relies on strong parametric assumptions of linearity and homogeneity between the instrument and the exposure to form the strata. If these stratification assumptions are violated, the instrumental variable assumptions may be violated in the strata even if they are satisfied in the population, resulting in misleading estimates. We propose a new stratification method, referred to as the doubly-ranked method, that does not require strict parametric assumptions to create strata with different average levels of the exposure such that the instrumental variable assumptions are satisfied within the strata. Our simulation study indicates that the doubly-ranked method can obtain unbiased stratum-specific estimates and appropriate coverage rates even when the effect of the instrument on the exposure is non-linear or heterogeneous. Moreover, it can also provide unbiased estimates when the exposure is coarsened (that is, rounded, binned into categories, or truncated), a scenario that is common in applied practice and leads to substantial bias in the residual method. We applied the proposed doubly-ranked method to investigate the effect of alcohol intake on systolic blood pressure, and found evidence of a positive effect of alcohol intake, particularly at higher levels of alcohol consumption.