Overriding $wp_query on a template

You are interfering with the main query/loop, which is bad – there is nothing more to say.

You can do a custom loop, see the codex article The Loop to start with, or use the pre_get_posts hook, if you want to do something other then the usual behaviour.

If you need to toy with $wp_query, for example to fix the pagination on custom loops, then restore it afterwards.

error code: 523