Inconsistent behavior is often the result of missing initialisation, in this example it could be the render state or some variable. So, double check your initialisation first, try to explicitly set a needed renderstate just before starting rendering etc. to narrow down the potential bug.
Thank you Sir.
I hadn't initialised my translation vector in the Transform class.