If the wifi adapter in your phone supports connecting to both simultaneously, then this is the expected behavior for all flavors of AOSP and even factory. The hotspot-connected device will use whatever the device's network connection happens to be. I believe it was the Pixel 3 or maybe 3a that first supported this (I had a 2xl that didn't do this, wife had a 3a that did).