It is doable --
There is another TB 2 port (female) at the back of Tuderbolt Display.
You can get a TB 2 cable (unfortuantely, Apple seemed to have 0.5 meter and 2 meter TB cable) connect between the display and "another" Mac Machine (you will need the TB3 -> TB 2 adapter for newer machines).
However, I only run 1 macine at a time (I used 2 Mac Minis: 2014 and 2020). That been said, I had to shut off 1 machine, then turn on the other one).
At the time, I used wired Apple Keyboard and USB mouse, both connected to TB display - so I did not have to switch BT connection either.
These days, Apple keyboard with lightning connection can easily connect to the back of TB display - to be recognized between 2 Macs. very straightforward. After the keyboard is connected, by detach the lightning cable, the BT function will be fully utilized.
If you want both Macs to be on at the same time, you probably have to physically connect/disconnect either of the TB cable.
Best