Can a supervisor extend the paper and change the order of authors?
If the paper was submitted without your knowledge and agreement, this is a serious problem. All co-authors are supposed to know about and approve a paper that they are listed on before it is submitted.  This would be an ethical breach by your supervisor.  I would at least raise it as a concern with them.  This is something that you could potentially raise with others, as well, such as someone else at your instutation, or even the journal.  Consider the consequences before you do anything, though: it's likely to have a major impact on your relationship with your supervisor, and therefore your PhD studies.

Beyond that, the situation is much more of a gray area.  Clearly the way things were handled, particularly the lack of communication with you, was not optimal.  But it's not so clear that it was "wrong" beyond that.


The PI directs the research of the group and has the authority to decide that someone else will now take the lead on a collaborative project.
It is a judgment call who should be first author.  If the other researcher made a significant contribution and put together the draft of this paper, they may have a legitimate case to be first author.  At least, it may be ambiguous enough that it would be hard to challenge.  Also, someone might feel that the first author on this paper should be the one who did the most on the revision/extension rather than the one who did the most overall.  After all, you already got first author recognition for the primary piece of work on the conference paper.  In a series of related papers that build on each other, who did the most recent work may be considered most relevant to authorship position.


Don't be too quick to assume intent. Your talk of the supervisor keeping things "secret" implies intent to sneakily do this behind your back.  I wouldn't necessarily assume that.

Perhaps your advisor is just poor at communication/management, and this was an oversight.  This is quite common; many professors are not good at managing a group of people.  Even submitting the paper without your knowledge may be an oversight (it shouldn't happen, but it does happen).

The advisor might even think they are doing you a favor by taking some work off your shoulders and getting something done that has been delayed.

Talk to them and make them aware of your concerns and see if you can arrive at a constructive solution.  It may be too late to undo what is happening here, but hopefully you can agree on a better way of working in the future.

If, after attempting to discuss this, you feel that your supervisor is acting in bad faith, you may want to escalate the situation.  But only do this as a last resort.