You're right of course but made to feel otherwise. It is illegal.
Cycles should always be on a road or on a designated cycle path. It probably wouldn't be too much of a problem if people behaved in such a way that they gave priority to pedestrians, cycled very slowly, always looked where they were going and gave way to anyone walking, etc. But since they don't, it can be quite dangerous and, of course, like so many laws these days, there's no enforcement by the Police.
Scottish political mess. Is Devolution working?