Yes. That shouldn't work. You can't define something as a constant value and as a function at the same time. At very least that would be very confusing and I'm not sure I know any programming language where it's possible.
You want to write something like:
f[x_] := a x
f[x_,a_] := a x
Or if you want to be more clever, you can use default values (https://reference.wolfram.com/language/tutorial/OptionalAndDefaultArguments.html)
f[x_, a_:constantValue] := a x