EDIT
It seems that you get the same error as Rigify Generate Rig Error Index 0 Out of Range 2.83.
Quoting blr's answer: should help you
In order for the Rigify Generate button to work, the option in Preferences > Editing > Objects > Duplicate Data > Armature must be checked.