What happens when devices request different voltages from a USB hub?
I plug an USB hub (potentially an old USB 2.0 one) in the (9V capable) charger


Then your device will get 5 V.

It's only able to request 9 V from the charger if it is attached directly to the charger.

And the old USB hub will not be designed to work with 9 V, since the USB 2.0 standard only allowed 5 V on the VBUS line. If somehow the device did signal to the charger to provide 9 V, it would most likely damage the hub.

In order to charge your device with 9 V, you need to connect it directly to a source that is designed to the USB Power Delivery standard or one of the earlier proprietary high power charging standards (both devices using the same standard).