Exactly, and you got a visa granted because you needed to stay in Thailand for a purpose, in this case a course. When course is ended you have no reason anymore to enter Thailand.
Nobody says the visa is not valid 5 years, you just asked them the wrong question. Chief of which Immigration bureau you did ask. Do you have contact info from Thai Foreign minister or do you just make up this story?
I did ask embassy and did ask Immigration office and both confirmed all visa requirements are in place the whole valid period of the visa. When you read official info at e-visa site, there also is no remark indicating the opposite.