The following is the text of the Officers oath of office.
I, [name], do solemnly swear (or affirm) that I will support and defend the Constitution of the United States against all enemies, foreign and domestic; that I will bear true faith and allegiance to the same; that I take this obligation freely, without any mental reservation or purpose of evasion; and that I will well and faithfully discharge the duties of the office on which I am about to enter. So help me God.
The Officers oath is to the Constitution, not the chain of command.
The enlisted oath is to Constitution, then the President and the chain of command.
"I, XXXXXXXXXX, do solemnly swear (or affirm) that I will support and defend the Constitution of the United States against all enemies, foreign and domestic; that I will bear true faith and allegiance to the same; and that I will obey the orders of the President of the United States and the orders of the officers appointed over me, according to regulations and the Uniform Code of Military Justice. So help me God."
I would suggest that means the Constitution comes first, and if there is a conflict between the first part and the second part, the Constitution wins the conflict.
True. However, this does not give each individual serviceman the power of constitutional adjudication. Servicemembers must accept the judgement of the civilian branches of government as to the constitutional eligibility of their commander in chief, as well as every other constitutional question.
To give the military the power to determine eligibility of the president would destroy the principle of civilian government.
That's why an individual service member who questions the eligility of his commander in chief, when that eligibility is accepted by all civilian branches of government, is committing treason.