What is the impact of a radical change of opinion for early-career academics? I'm wondering what are the potential consequences of a change of mind in the social sciences and humanities. More specifically, what would happen concretely if I publish a peer-reviewed article in which I develop a fierce critique of, say, Rawls and then, change my mind and publish another peer-reviewed article in which I adopt a Rawlsian approach to politics? 

Another example would be beginning an academic career as a liberal and then changing to a socialist perspective (or vice versa). John Stuart Mill changed his mind and, more recently, John Gray also did. 

But what happens if a regular young academic like me does it? Would my peers consider this as a weakness?
This is a very good question and one that I have given some thought to when my own opinions changed while I writing papers expressing particular positions. 

While there are different ways I could see this playing out, I will focus what I see to be the most probable outcome - that totally changing your position on your core area of research (which for a young academic is probably your only area of research) would be a bad thing to do for your career in academia. I feel that it would be a bad thing to do as it would be detrimental for how you would be perceived, and in turn have implications for your ability to effectively befriend other academics and build networks - something which is very important for career development. 

Just to be clear about my assumptions in saying that - I assume that academics are much like normal people, and therefore that success in an academic discipline will be influenced by many of the same factors that lead to success in other social systems. Additionally, I am assuming that what you are doing is contrasted against publishing a paper which builds on the prior paper - probably a more common approach. I am also assuming that what you are interested in here is the likely impact on your career.

Operating on these assumptions and my intuitions from my own experiences over the last 4 years, I think that it is likely that your act of inconsistency, i.e., changing your views 180 degrees, would alienate a lot of fellow academics. As you are clearly being inconsistent - in the sense that you once strongly advocated one position, but now advocate another, you will be seen as an inconsistent person, a personality characteristic that people generally dislike/disapprove of[1]. As fellow academics will perceive you as being inconsistent will it is more likely they will like you less and be less willing to work with you. For example, they will be more likely to think that in the midst of a positive professional relationship, you might suddenly going to decide that you no longer share their beliefs; that you might even turn on them and publish a critique on work that what you have done together. Thus they will percieve greater uncertainty and risk in forming relationships with you. This concern may also be shared by those who are considering hiring you. For instance, when applying for a job the review panel might look at your resume and be unsure if you are going to work well with the ongoing research within the faculty - you are not really  

You might also end up slowing your reputation gains. People usually associate researchers with a particular position - i.e., "he/she researches x". The researchers who make it are those who become really well known for researching that area. People say "oh, you want to know about x? Have a look at Y". By being more inconsistent you may slow and weaken that association and become slower at building reputation. For instance, if your second paper extends your first paper rather than invalidating it, then it is probably more likely to build the link between that area of study and your expertise as it will involve you covering new content and further emphasizing that you know a lot about this area. In contrast, if your second paper is saying " you know that things I was sure of last time? Well I think I was wrong about it" then this doesn't really signal that you know what you are doing, or that have really figured the area out. It also begs the question; "if you changed your mind before, then might you not change it again?".

[1] Guadagno, R. E., et al. (2001). "When saying yes leads to saying no: Preference for consistency and the reverse foot-in-the-door effect." Personality and Social Psychology Bulletin 27(7): 859-867.