Sounds logical...let's analyse it .
In an ic engine the fuel that burns genrates kinetic energy enough to compress the air fuel mixture for the next cycle and generate electrical power with an alternator to charge the battery and operate the spark generation units and drive the load.
But in the case of a solenoid the electrical power is converted into mechanical energy with a coil attracting a solenoid in a moving iron system or attracting or repelling a Magnet moving in an electromagnetic field to create motion .
This force of attraction or repulsion could be connected with a cam assembly to create rotational motion and a timing circuitry be used to energize the coils.
All the energy for the solenoid is electrical and should be provided by the electrical circuit to create the rotational motion. And there is no additional source of energy in the equation.
The more energy Efficient conversion would be a simple electric motor. Hence the system would be inefficient considering friction in the electromechanical system.