Under the Vacancies Reform Act, a president may pick someone other than a No. 2 official to serve as acting head of an agency so long as that appointee is either a sufficiently senior official at the same agency or is currently serving in a Senate-confirmed position in the broader executive branch.
https://www.nytimes.com/2019/08/02/us/politics/john-ratcliffe-sue-gordon.html
.