Working with a professor who does both mainstream and non-mainstream physics research
A well-established researcher usually has multiple research programs that are loosely united under one common theme. As such, they will have different reputations in different circles of academic research. A professor, for example, may be well-regarded in computational chemistry, but his work in biological modeling may receive little attention. Since a researcher in computational chemistry will probably not follow the literature in biological modeling very closely, the computational chemistry community may actually know little about the said professor's work in biology. Thus, to answer your question, how you will be judged depends on which of the professor's research program you are associated with. If you are really concerned, then you can simply stay away from the non-mainstream research that the professor is working on.

With that being said, I want to push back a little bit on the assumption of your question. It is sometimes joked that the sign of senility in a biologist is that s/he starts to work on the problem of human consciousness, which for a long time was not regarded as proper research subject in biology or psychology. But if the "non-mainstream" research that you are referring to is not downright unscientific, your concern may not be well-founded. Sure, as a young scientist it is not wise to work on unpopular subjects, but the popularity of a subject and the fad associated with it is not always correlated with the soundness of an area of inquiry. Sometimes good science is just not popular (such as Mendel's work that laid the foundation of classical genetic analysis).