I've read this thread on subject-aux inversion:
english.stackexchange.com/questions/341696/… . I do not find the sentence provided by the OP to be unnatural, "Only when the rule can have some meaningful effect it is to be applied." On the contrary, inverting it to
is it to be applied is unnatural to me. This is because I find the clause modified by
only to be rather lengthy and thus unemphatic like to be inverted.