This is known as a Motor-Generator set or MG set.
With lower CO2 demands large motor designs (>>10kW) now have premium efficiency standard (IE3) and premium efficiency motors (PEMs) that can reach 96% near 100kW. Thus a 4% loss minimum at optimal loading for each component.
For tiny motor generators, you can expect much more losses. have fun with it. It demonstrates you awareness to energy conversion for mechanical stored energy and electrical generation of energy, voltage, current and frequency but losses are unavoidable. Its a Law of Physics. Many examples of over-unity are examples of measurement errors of (peak to Rms) and ignoring the stored energy in magnets which also contribute and get depleted.