To try to be helpful and to sometimes speed things up Mathematica remembers past assignments and silently uses those assignments later. I am guessing this explains part of what you are seeing.
Sometimes you want it to forget a prior assignment. Thus you have used
ClearAll[all]
What that does is completely forget any value that you might have previously assigned to a variable called "all". From the documentation, But, at least in the code you have shown, there is no variable called "all" and no contents have been assigned to it and so that does nothing. In particular it doesn't forget any prior assignments to x, t, or anything else.
You can even try a little experiment like this
x=3;
all=4;
Print[x]
Print[all]
ClearAll[all]
Print[x]
Print[all]
I suspect what you might want to use instead is
ClearAll["Global`*"]
which tells Mathematica to look in the global database of assignments and forget everything in there. You can find that in the documentation for ClearAll if you look carefully for that.
Even without making that change to your code, it may be impossible to exactly reproduce all the steps you have previously done and get it to give you the same error message for exactly the same reason. If you were able to do that and could be certain the error message was coming up for exactly the same reason then you could try making that change to ClearAll and reproducing those steps yet again and see if the error did go away.
It might be possible to just restart Mathematica, without needing to restart your entire computer. Restarting Mathematica should forget prior assignments, unless you have put some assignments into the initialization code for Mathematica.
See if you can use this information to get to a place where you can be really confident about what it is doing. That is probably essential for further productive learning and work.
None of this even tries to address using units in DSolve, that is an entirely different topic.