Vice President Kamala Harris swore in Ms. Bass in a ceremony that celebrated her historic win but also underscored the obstacles she will face.