Query arg not available on init

The query_vars filter does not run until after init. The earliest hook you can use get_query_var() is parse_request, which runs after init, but before send_headers, wp, template_redirect, and template_include.

error code: 523