Why does Ulfric think I am a Stormcloak

pcthe-elder-scrolls-v-skyrim

After around 200h of game play I finally decided to join the Legion and take out the racist Ulfric (I am an elf…).

However, after completing The Jagged Crown (and being very suspicious of why any of the Stormcloaks weren't attacking me) I started Message to Whiterun. However, when I go to talk to Ulfric, he completely thinks I am a Stormcloak and the next mission starts as If I were.
What is happening? How can I make clear that I am not a Stormcloak? A polite mail to Ulfric is not possible, so what should I do?

NOTE: this may be the reason of the bug: Long ago I joined the legion (but didn't want to) so I reset the mission with commands. Later, to restart it I also needed to do it with commands, starting The Jagged Crown directly.

Additional information: I tried setting the stage of Message to Whiterun to different objectives. The best I did was to actually reach Whiterun and talk with the Jarl, but then the general leading the defense doesnt want to further advance the mission. I can't either start the siege of Whiterrun by command lines, I don't know why.

Best Answer

I belive you used the wrong Quest ID when you restarted the quest. The Jagged Crown can be done by either faction however on the Unoffical Elder Scrolls Page we can see there are 2 different Quest IDs with the same numbered stages (excluding the unknown ones)

On the Wikia you can also see in Quest ID the 2 different ID, however even if you used the Stormcloaks ID by mistake there is a way to reverse it before the quest complete under the Optional betrayal - switching sides part

While the Jagged Crown is in the possession of the Dragonborn, they can also decide to travel to the capital city of the opposition to hand over the crown to either General Tullius in Solitude or Jarl Ulfric Stormcloak in Windhelm. The leader of the opposing faction will accept the crown and unceremoniously recognize the Dragonborn as a member of their faction. From there on, the Dragonborn will fight the Civil War for their new allies.

if you have already completed it then you have 3 options.

  1. Reload to before the option to betray (if you have the save)

  2. reset the mission like you have done previously and redo the command, this time either using the Quest ID for the Imperial's Quest or remembering to betray the Stromcloaks before you finish the quest

  3. Ulfric trusts you, this is your chance to kill him in the name of the Imperial Legion! (not sure if he is set as essential though)