The undo action should be able to handle slots other than the main slot. However, since undo is handled by EditPage, and EditPage currently only supports the main slot, the best we can do for now is to fail gracefully when asked to undo an edit of something other than the main slot.
Eventually it should become able to handle multiple slots at once (when they are edit atomically, or when the edit spans multiple edits which changed different slots), see T189808: Make undo work with multiple slots..