@Jan *****************
Every country will have it's own website with rules, but it is a common rule for applying visa worldwide.
For Thai embassy in Netherlands this is the link:
************************************************************************
I think it is very clear and also logical.
IMPORTANT:
Thai Visa is for entering Thailand. It is therefore issued to those who are outside of Thailand and will visit Thailand. Therefore, your visa application will be rejected if you are already in Thailand during the visa process.
Royal Thai Embassy, The Hague, has the authority to provide visa service only to those who are in the Netherlands for the entire visa process. Therefore, your visa application will be rejected if you are outside of the Netherlands.
P.S.
When your flight is before the visa arrives, that does not mean visa is not issued in time, but it means you planned your flight wrong.