A median of a distribution F : \mathbb{R} \to [0, 1] would be any m \in \mathbb{R} that satisfies:
F(m) \geq \frac{1}{2} \quad \text{and} \quad 1 - F(m^-) \geq \frac{1}{2}.
Now let Q(p) = \inf \{ x \in \mathbb{R} : F(x) \geq p \}. Fix any p \in (0, 1) and set q = Q(p). Let x_n \downarrow q. By right continuity of F we have F(x_n) \to F(q) \geq p. Furthermore, by definition of q we see that whenever x < q, then F(x) < p. So if x_n \uparrow q, then \lim F(x_n) \leq p which shows F(q^-) \leq p and thus 1 - F(q^-) \geq 1 - p.
In particular, m = Q(1/2) is always a median of F. Similarly, you could define that the “first quartile” is any q \in \mathbb{R} satisfying:
F(q) \geq \frac{1}{4}, \quad \text{and} \quad 1 - F(q^-) \geq \frac{3}{4}, which is again satisfied by Q(1/4). Generally, this will give one way to obtain some notion of \text{IQR} via
\text{IQR} = Q(3/4) - Q(1/4).
However, the inequalities that the quartiles have to satisfy do not necessarily have unique solutions.
In particular, for a finite list of data points, you could assign a discrete distribution to this and the above generalizes. Essentially, if you have a sample \{ X_1, …, X_n\} then you’ll attempt to find the IQR without knowing the actual distribution of X. In other words, you’re looking for an estimator for Q(3/4) - Q(1/4) from our sample. Some “good estimator” happen to be the discretized methods offered in wiki (both the high school and your definition are equally valid), whereby we obtain an estimation of the IQR of the underlying sampled distribution. One can imagine that “good estimators” at the very least would check if their expectation converges to the underlying IQR and how the error of the estimator behaves as you increase the sample set. As you’d know, it’s not far fetched to imagine that interpolation also works as a metric to improve the quality of an estimator.
Tldr; if you take a discrete distribution on something like {1,2,3,4} then any real number on the interval [2,3) should be a median, so you have as many medians as real numbers. Your “rigorous treatment” only really works nicely for continuous distributions with nice densities and there’s no unique definition for the discrete case. The methodology you’re using is just the nearest rank definition of quantiles with some rounding, and that isn’t any more “rigorous” than the “high school” definition, so i’m not sure what your caveat was. In fact, the nearest rank definition isn’t even the optimal choice for sub 100 element finite lists, but that’s besides the point. Anyhow, different definitions leads to different answers and thus a disparity in quartile values is not a surprise owing to there being multiple things which are all not well-defined to be something unique.