I read this as the engine wasn't cranking at all (so not the "compression bump"/ weak battery issues).
and "Then when I turn off the ignition key and switch it back on, most of the times it does start and after that all is normal" also suggests it's not a weak/old/corroded battery.
Both of those well described situations (THANK YOU, Jurrien
) sound like the starter solenoid is NOT getting the +12v signal it needs to activate the starter from a healthy battery. Even a corroded battery connection usually 'clicks' before it doesn't crank.