Ah, that's good info -- another mod I have is calling reset_technology_effects() when that event fires, which is.. totally overriding you. I'll file a bug report with them, because that's entirely redundant in the first place, but I guess you could also solve it on your end by also handling on_technology_effects_reset.
EDIT: Hmm, removing the mod in question didn't fix it, but, indeed, adding this handler did.
script.on_event(defines.events.on_technology_effects_reset, force_unlock_variants)
I guess there's multiple mods doing the same pointless thing.