I found that this happened when i dragged and dropped images into photoscan that had already been rotated 90 degrees externally (in my case rotated in windows explorer).
I haven't tried python scripting yet, but i think it is likely the same cause.
EDIT: Having said that, I can't now recreate the problem, maybe it was fixed in the latest release?