new object at angle

when i executed a functin for creating an object

the first time it is created at an angle but when i erae it and then re execute the function
the object is as per global axis

what could cause this behavior?

Thanks