add test for #22024
fix #22758: Removing top instrument with instrument name engaged in part causes crash