In a typical OSD script there is a line that looks like this: REMEXEC40=ldrun diskinfo extend_last_partition
That line will extend the last partition on the disk. Check to make sure that line is in your script. If it is, check your partition list in diskpart. There may be a hidden partition at the end (such as a recovery partition) that was captured and therefore is being expanded as the final partition.