The electromagnetics solenoid does not directly cause slides to move & reverse the refrigerant flow. It serves only as of the first falling domino in a short series of actions. The solenoid is connected to a pilot valve, which acts like a mini reversing valve allowing the slide to move.
When the solenoid is activated in cooling mode, it slides out the pilot valve. The re-oriented pilot valve may redirect the refrigerant flow and create a pressure difference in the opposite direction to the reversing valve. The pressure difference forces the slide to move to the other side, which sets the system back in cooling mode.
You can see these in actions by looking at the sequence of little red arrows in the image below. Systems are in cooling mode as the pressure differentials are on the right and have pushed the slide up from its positions in the previous cutaway images. However, the pilots' valve itself does not create a pressure difference.
The compressor creates a pressure difference when it pumps steam. If you have weak or faulty compressors, it may not be creating a strong enough pressure difference to effectively switch between heating and cooling modes. Look at the normal discharge line in the image above. The red arrows go into it, but they also go to the pilot valves.
They flow through the pilot's valve & create a pressure difference that pushes the slide to the right. If the vapor pressure in the discharge line is too low, it may not be strong enough to push the slides in either direction. Since the reversing valve requires a pressure difference to switch operating modes, the reversing valve may not function when the system has no power for a while. However, it may still slide and change modes if you have just turned the unit off.