Your test will ONLY work if you're eating enough gluten to build up sufficient antibodies to test positive. I think the links below show much you need to eat. Have a look and make sure you're well over the limit. If you've been eating less than the recommended amount I'd be tempted to postpone the endoscopy until you have, as you don't want to have gone through all that hardship without getting a definitive result.
Eating enough gluten is not to do with how ill you feel or how quickly you react to gluten. If you're not eating enough of it for your body to develop antibodies, you simply won't test positive. The test actually measures these antibodies. No gluten = no antibodies = negative result.