For devices that keep having same problems after flashing with single file firmware, you will need to use repair firmware for them. This repair firmware has 4 files inside so you will have to load all of them in odin to do that follow the procedure below

Boot phone into download mode (Volume down + Home + Power key)

Connect device to PC

Launch odin

Click BL button then select file with name starting with BL in firmware folder

Click AP button and select file with name starting with AP in firmware folder

Click CP button and select file with name starting with CP in firmware folder

Click CSCbutton and select file with name starting with CSC in firmware folder

You can also click PIT and select PIT file (optional)

When all the files are selected, Click Start button and wait for flashing process to complete