This can happen if you use the last take from a multi-take Real Instrument recording, where you stopped recording before the end of the cycle region. To prevent this, always allow the playhead to go back to the cycle region start before you stop recording. A new take will not be created unless recording continues a certain amount into a new cycle, so this should not result in an extra unwanted take.
GarageBand: Loops created from Multi-Take recordings are sometimes short
In some cases, loops you add to your Library from multi-take Real Instrument recordings may be shorter than expected.