How can a present software-engineer (with experience of 5 years at least) turn into a physics professor? There are often many people who switch careers midway. Some from software engineering to a product management role which is quite popular given relevance of previous career to current career. Another example is software engineer to a data scientist. Some might be less relevant but still have the same corporate setup, for example, a software engineer to supply chain engineer. Some might be irrelevant like software engineer transitioning to teaching high school physics but transitioning is still easy. Some might be super irrelevant and 'risky' like software engineer with 5-7 years of experience, going to study masters in physics then a PhD then couple of postdocs and finally becoming a professor in say high energy physics.
I exactly wanted to know about the last case, how can a present software engineer with &gt;4 years of experience in software engineering, pursue physics and establish a successful career (PhD, post-docs, then professorship) in physics academia.
Your situation does not sound fundamentally different from any other university graduate.
Your work experience will possibly give you some technical and time management skills that others don't have, but you'll just have to put your skillset to good use like every other graduated student.
Note, that going to graduate school for the sole reason to become a professor is a bad idea. The odds are extremely slim. So if you're not enjoying the process/path you'll likely be disappointed. If you're loving doing research with very little income go for it!