Autocorrelation of a signal comprised of only the same number
What you see are mainly numerical effects, even though the second result is actually correct, but not according to what Matlab intends to compute. But let's go slow ...

Matlab computes the autocorrelation function by first subtracting the mean of the signal and then correlating it with itself. Then the autocorrelation function is normalized such that its value for lag 0 equals 1 (this is where you get the NaNs from).

What happens in your case is that the signal equals its mean (because it is constant), so by subtracting the mean you generate a zero signal, the autocorrelation of which is zero. Then in the normalization step you divide the zero signal by its first value (which is zero), and you get NaNs. This shouldn't happen in a well written function, so you could complain with Mathworks about it.

What is even worse, is that this behavior is not consistent. You found some scaling values for which you actually get a reasonably looking autocorrelation function. This is really weird but I think I understand what's going on. Try the following. Look at the values of

signal - mean(signal)


This is what Matlab bases its computiation on. What you'll see is that for the scaling values which give you NaNs, this difference is exactly zero (which is the correct result). For the other scaling values (which give a well-behaved autocorrelation function), this difference will be some constant in the order of $10^{-17}$. So you're again left with a constant signal, albeit it much smaller than before. The autocorrelation function of such a constant signal (without subtracting the mean, because this has already been done) is triangular, simply because it is the convolution of two rectangular functions. The normalization gets rid of the $10^{-17}$ factor and you actually get a nice looking autocorrelation of your signal. This one is even correct if you were to compute the autocorrelation without subtracting the mean of the signal (but this is not what the Matlab function intends to do!).

Conclusion: the first result (NaNs) is useless but at least consistent with the definition of the autocorrelation function used by Matlab (even though a division by zero should be prevented in a good program). The second result is not consistent with Matlab's definition of the autocorrelation, but it is - due to numerical errors (!) - correct when the autocorrelation is defined without first subtracting the mean of the signal. Note that both definitions are used in practice so it's always important to check what is actually meant by 'autocorrelation'.