As far as I know, "a such thing" is not correct. I can't think where that would make sense.
"such a thing" means something like "an example of (this) thing".
"What made you think such a thing exists?" = Why did you think that a thing like this exists?
"I've never seen such a big carrot" = "I've never seen a carrot as big as this before".