When this happens the most common problem is that to much material was removed from the thumb safety causing the sear to move when engaged. The way a gunsmith showed me how to fix this problem was to lay the safety on a vise or something firm that won't give so the the part of the safety that engages the sear is pointing up, take a small hammer and give the top of the part that engages the sear a firm tap with the hammer. This will cause the metal to spread hopefully enough to block the sear from moving. This is trial and error, if it spreads too much you can file it down. If that doesn't fix the problem then you need to take it to a competent a gunsmith since there might be other issues.
It needs to be fixed before put into action.