Is it really impossible to become a professor?

In addition to what others have said, I’d like to add that academia is a strange animal. Some academics have spent their entire lives focusing on their research and teaching, while others spent substantial time in industry before jumping into academia. If you choose to get a PhD in CS, you will be exceptionally employable - unlike some PhD studies, which have little discernible value in private industry, computer science PhDs have a TON of value in the private and public sector.

From what I’ve seen, a decent number of brilliant CS PhDs make switches between industry and academia throughout their careers. For example, I had a job recently at a highly profitable company that actively sought CS PhDs to help develop proprietary algorithms to help clients. These PhD employees sometimes came from university research positions, drawn by the allure of doubling or tripling their salaries; meanwhile, some employees left the company to go into academic pursuits after they found specific research studies that would require effort beyond what a client would be willing to pay for.

Your plan isn’t bad at all: if you love computer science, then you will enjoy your course of study; if you change your mind about your career choice, you will be abnormally well-prepared to make that pivot without a ton of sacrifice!