Reading up on the office of Cardinal….there’s no time-honored, set criteria. At some point in the past, even laymen were picked as Cardinals. In recent history, even priests have been chosen.
In most cases, if non-bishops are chosen, they are made bishops. But it’s not a requirement.
So the question becomes…since the main duty of a Cardinal is of the human/govt realm (ie to elect a pope and govern the Roman Curia offices), then it makes sense that even if a pope were a heretic (ie only holds material/govt power…in the SP view), then he could still rightfully appoint Cardinals being this appointment/office is mostly of a govt function.
The fact that some may be only priests (or none at all) would not impede their function as pope-voters, but would impede any spiritual functions only.