Another user reported this behaviour to us not long ago, and I eventually managed to narrow it down to the following situation...
If you make a selection using the 'Mark Track Below Current Line' key binding, or you make an equivalent selection by pressing the 'Flexible Mark Below Current Line' key binding (Alt + Z by default) 3 times, then Renoise will incorrectly add an extra line to the end of the selection.
You won't be able to see it directly, but it does get included when using the 'Render Selection to Sample' function. Your newly rendered sample will include +1 line of whatever comes next in your song sequence, whether it's silence from an empty line, or whatever else.
- Make a new pattern that's 16 lines long (or some other length less than the maximum 512 lines).
- Move the cursor to the top of the track.
- Press Alt + Z three times to mark the whole track.
- Change the pattern length to 17 lines.
- Notice that the originally hidden/non-existent 17th line is already selected.
Definitely quite an obscure bug that managed to slip under the radar. Will be fixed in the next patch