This may not be everybody else's problem but for me, I discovered today (after multiple reformats and a factory reset) that Samsung Pay Simple Pay option was the problem. Turn off Simple Pay within the settings of Samsung Pay app and the sd card should stop self-ejecting.