actions: fix assertion fail at double clear (#4038)