I think I know what's the cause is: I am near my limit (42/43) when my viceroy dies, and his vassal counties and duchies transfer to me. This makes me go over limit - and then those events that make vassal independent ("True and loyal vassal" and "We are not pleased" ones) on inheritance fire and they go independent.
That viceroy might have been over limit too, because I gave him 6 large kingdoms (Poland, Pannonia, Germany, Pomerania, Bavaria and Great Moravia)
This is ironman, so I don't have a save before it happened.