Looks like the usual issue of switching a mux behind the back of the driver.
You have one software instance of proximitySensor. You instantiate it once, connect it to one device (where it likely configures things on the sensor) and then switch the mux to another device and try talking to it without initializing it…
Look at viewtopic.php?f=105&t=54277&hilit=entrant#p220782 for an example of using an array of instances for each mux channel.
/mike