Variable X computes a self-index with an implicit dimension in its result, which gets promoted to become the self-index. The implicit dimension has a different length when computed in Mid-mode than it has when computed in Sample-mode, which introduces an inconsistency. The promoted self-index must not depend on whether it is computed in mid-mode (deterministically) or in sample-mode (probabilistically).
The result of a variable has an implicit dimension, but that implicit dimension is different when the variable is computed deterministically (i.e. in mid-mode) than it is when computed probabilistically (i.e., in sample-mode). Since the implicit dimension is promoted to become the variable's self-index, this is represents an inconsistency. The self-index must be the same whether computed from mid-mode or sample-mode.
This index definition, with a random length, is inconsistent because when evaluated in mid-mode and then later in sample-mode, by chance the lengths end up different. This doesn't present a problem if you never try to access the probabilistic view.
Index J := 1..Random(Uniform(10, 20, integer: true))
Var x := LogNormal(10, 3, integer: true) Do 1..Round(Mean(x))