If it were after hours, I might would understand if they nicely said 'we are closed', but to treat you that way before their closing time, well that's just not good customer service! You are right to complain. Hopefully they won't be doing that again in the future.
Take care and good luck!