According to your post, all you did was format the system in TWRP? Do you still have TWRP installed? If so, you can just flash another rom. Otherwise, have you tried just flashing the stock tar file in Odin? I'm assuming I'm missing a big detail, as to why you went from wiping the system in recovery, to having a bigger issue.
Sent from my SM-N900T using Tapatalk
If we could change ourselves, the tendencies in the world would also change. As a man changes his own nature, so does the attitude of the world change towards him.
We need not wait to see what others do. -Gandhi