According to Samsung https://www.samsung.com/us/support/troubleshooting/TSG01003409/ both of those error codes typically relate to the ice maker:
39E, 39C: Ice Maker Function Error
40E, 40C: Ice Room Fan Error
One trouble shooting step you could take is to inspect the interior of the ice maker for any ice buildup/blockages (that could be preventing it from closing properly and or/interfering with the fan).