A longtime lady-in-waiting to Queen Elizabeth II and aide to the royal family has stepped down over alleged comments she made to a Black woman visiting Buckingham Palace that went viral on social media.