According to [this:](https://people.csail.mit.edu/albert/bluez-intro/c404.html#:~:text=The inquiry lasts for at most 1.28 \* len seconds) the timeout is at most len * 1.28 seconds. Since you've got a value of 16 for ii, then you can expect hci_inquiry() to take no more than 20.48 seconds. Since ~7 < 20.48, it looks to me that hci_inquiry is working as advertised.
"A little song, a little dance, a little seltzer down your pants" Chuckles the clown