Derivative of a constant not making sense I'm studying calculus on my own and I came across something weird:

The derivative of $x^n$ is $n\cdot x^{n-1}$, and the derivative of any constant is $0$. Also, any constant $x = x^1$. However, the derivative of $x^1$ ($x$ being any integer constant) seems to be $1$: $n\cdot x^{n-1} = 1\cdot x^{1-1} = x^0 = 1$. What's failing in my reasoning?
Let $a$ be some number and $D$ be the differential operator (the derivative).  Just for fun we'll use the notation $x\mapsto f(x)$ to represent the function $f$.  This notation is supposed to be pretty intuitive: in it $x$ is an arbitrary element in the domain of $f$ and $f(x)$ is the number it maps to under $f$.

We know that $$D(x\mapsto x^n) = x\mapsto nx^{n-1}\tag{1}$$ and that $$D(x\mapsto a) = x\mapsto 0\tag{2}$$

So then does that mean that $D(x\mapsto a^n) \stackrel{?}= x\mapsto na^{n-1}$?  No.  Of course not.  $a^n$ is just another number so we follow rule $(2)$ to get $$D(x\mapsto a^n) = D(x\mapsto b) = x\mapsto 0$$ where $b=a^n$.
Please note that a constant is not a  constant function. We can try to derive functions, we can surely derive constant functions, but we certainly do not derive constants.  So, yes, anyway, derivative of a constant doesn't make any sense.
Another preliminary remark : the expression $x^n$ in the function $f : x \mapsto x^n $ is the value of the function on $x$, not the function. If you write the function $x^n$ (or worse $x^n$ alone) you should keep in mind that it's just a (bad) shorthand notation. For example you can't really derive $x^n$ and $c$ you derive the functions $f : x \mapsto x^n $  and $g : x \mapsto c$. If you forget that it can lead you to mistakes...

What's wrong in your reasoning is that you used the $x$ symbol with $2$ different meanings without noticing it.
When you write $x=x^1$ and say $x$ is a constant it's ok, it could be, even if we generally use $x$ as a variable name. But when you say you derive $x^1$ and its derivative is $1$, implicitly, you derive the identity function ($Id : x \mapsto x $) where $x$ represents no longer constant. Try to use different names for your constants and your variables in function definitions and it should be ok.  For example if you want a constant function whose value is $x$ write $f : t \mapsto x $ and if you don't really need to name $x$ the constant you could use this more common form : $f : x \mapsto c $ where $c$ is the constant and $x$ the variable.