The problem stemmed from a third-party clustering library, which removes markers that fall outside the visible map area, thereby preventing deselection from functioning correctly.