For Details you can go through this thread & search for temp sensor (Engine coolant sensor) & gauge as it has been discussed in detail earlier.
In short, according to given info, i think your temp gauge (dashboard) is not accurate and the temp sensor (t stat housing on the intake manifold) is OK.
You are also mixing temp sensor and temp gauge in your post.
Just keep in mind that the halfway mark of the needle on ur temp gauge means Full Engine OVERHEAT ( H ) it should remain quarter or below in this case.
The mechanic must have fiddled with some thing else as connecting the radiator fan thru T stat switch has no connection with engine knocking until and unless fan is not kicking in at right time and engine is over heating