Become researcher after PhD at 40
It depends a lot on the field you are in. In some fields, almost everyone who ends up being a professor has had a previous career outside academia. An example is education where your previous background will be considered a plus and there is no stigma attached to being older.

But there are also fields where yours would be a very uncommon career trajectory and where people have the perception that researchers' best contributions come when they are still young. Mathematics would be an example. In these fields, you will probably have a harder time finding a career as a researcher in academia, though I suspect that it makes little difference if you are going for an industrial research position.