The behavior sounds like a bug and the description seems to match PR1036020. If you open a ticket with JTAC they could verify if you are hitting the PR. Or you could try the upgrade to the "Resolved In" versions 12.1X47-D15 12.3X48-D10 to see if the issue clears.
https://prsearch.juniper.net/InfoCenter/index?page=prcontent&id=PR1036020