fix #19287: Removing and adding linked staff and creating score causes crash