Align elements to a locked element
Not sure if this is a bug or working as intended, but you can't align an element to a locked element. You have to unlock the element first, then do your alignment, then re-lock that element. Which is kind of annoying.
Currently, this is working as designed since locked elements can't be moved.
Note that you can select and align the non-locked elements, then move the aligned selection and you'll be able to snap to the edge of the locked element without having to unlock/relock it.
I suppose if there's only 1 locked element selected in a multiple selection then the locked element could be the element that is aligned to. If there are multiple locked elements then we'd have to arbitrarily choose one. Is that how you'd like it to work?