I attempt write alt. patch with use spellmod (source of recent cleanup commits ) but this have 2 problem for this case:
1) we reapply only auras that not have duration (maybe possible allow reapply auras in state duration==maxduration so recently applied in same tick.
2) we not support reapply for cusom spelmods that not applied by some spellmod auras. maybe this need imlemented anyway becaus we have like custom spellmods and its can not reppaly to already applied affected auras.
In current form you way will work only if 16246 triggered after 51466/ranks, so correct work dependent from internal aurs list proccessing order.
Maybe this only possible order, but i not so sure.
One from ways fix without big chnages add symmetric aura scan for 51466/ranks aura apply but search 16246