Connecting multiple devices and speakers
Never connect two outputs together. They fight against each other. This means extra dissipated power, even blowouts. By circuit diagram level check is possible to find, if two or more outputs can be connected parallel, when only one device is powered and the others are off. Without exact diagrams, forget it!

You must have selector switches that ensure only one output is connected to one speaker. Stereo is handled by two sets of rotary selectors on the same axel.

The speakers have two wires each. That implies you actually need 4 selectors for a stereo speaker pair. Without exact circuit diagrams it's impossible to be sure, if another speaker wire could be allways connected to each device.

If you have one speaker pair and N devices for them, then you need QUAD N to 1 single axel selector that is robust enough to stay alive under the highest output power of your devices.

ADDENDUM: In case all the signals are low level line outputs with a clearly defined ground, a simple - even a passive few resistors only mixer is a possible solution. The outputs for plain, not amplified passive speakers and the headphone outputs make this a gamble until it's sure that there exists a well defined ground and no floating outputs. By still having all your devices in a good shape and if all worked ok, when the outputs were together then you very likely have just the lucky case. The passive mixer is simple: only one 1...3 kOhm resistor to all hot signal wires, grounds without resistors and the free ends of the resistors all together to the hot wire of your speaker input. You need 2N resistors for N devices. By making the resistors to have different resistances, you can balance the different output levels of the devices. More Ohms -> less output from speakers.