Really odd possible bug with importing multi-track file

Ok, I’m stumped on this one… its consistently wrong. The “sometimes works” was due to working ok with modified stereo tracks.

I’m currently re-formatting some sampled drum files using ffmpeg to make the sound files more appropriate for playing “live” (or at least triggered by midi and/or a midi roll). The idea is to merge the stereo into mono so that I can I can pan it to my hearts content and also so I can pitch shift the toms a bit so I can fake a couple more than there are samples available.

This is done by the following:
Extract all channels into mono files.
Merge stereo pairs into single mono files.
Merge resulting files into single multi-channel file.

As an example this is what happens with the kick drum (7 channels mixed down to 5).
ComplextFile > KickIn KickOut KickBase Overhead-L Overhead-R Room-L Room-R
Overhead-L & Overhead R > Overhead-Mono
Room-L & Room-R > Room-Mono
KickIn KickOut KickBase Overhead-Mono Room-Mono > NewComplexFile

To make sure everything works as expected I then import the 5 mono tracks, and the NewComplexFile twice (once as 1 track per file, and once as 1 track per channel).

Looking at the visual representation of the tracks everything seems good. All the mono track pairs (KickIn KickOut KickBase Overhead-Mono Room-Mono) match up from the initial mono creation and the one track per channel. The tracks in the new multi-track file also match up visually with the mono track (Channel 1 matches KickIn, etc.)

I then disconnect all the track outputs as they go to master (not where I want them) and then route all the mono tracks (all 10) to a bus (headphone) that goes out to the headphones (channel 3&4) of my audio device.

Playing back the mono files and comparing KickIn(original extract and created mono merge tracks) to KickIn(extract from NewComplexfile) they match up correctly. The same holds true of all the other pairs of identical files.

For the NewComplexFile track sometimes a channel will not match its mono track and sometimes a channel will be exactly the same for more than one mono track. All the visual representations of the channels stay consistent with their expected channel.

For this particular instrument the channels are doing the following:
Channel1=Extract2
Channel2=Extract4
Channel3=Extract3
Channel4=Extract5
Channel5=Extract5

The issue seems to be consistent across all processed recordings for that instrument.

Listening to the tracks, there seems to be an audio disparity between what the duplicated (last two channels in the NewComplexFile, but individually selected) channel sounds like and what the extracted track sounds like. It sounds like the NewComplexFile channel 4 or 5 are the same as the Extract5 and Extract1 combined, or it might be Extract4 doubled (my hearing says either of those are so close its difficult to tell but the Extract5 and Extract1 seem to be slightly ahread).

For a 5 channel instrument mixed down to 4
Channel1=Extract2
Channel2=Extract3
Channel3=Extract4
Channel4=Extract4

For a 4 channel (just overheads and room, such as for cymbals) there are no issues with the resulting two channel file.

Things I’ve done to narrow down the issue.
Tested multiple drum instruments.
Rebooted.
Created new session.
Imported just a single instrument, and multiple instruments, and single instrument multiple times.

Tested an original 7 track kick sample which exhibits the same issue.

The original files were not created by myself. The credit goes to a Mr James Peters Original source.

I’ve uploaded a single multi channel recording, the script, the original extracted files, the combined stereo to monos, and the new multi channel file.

Link to 7z of files.

Edited to add: I’m on Debian Forky and Ardour is Ardour9.7.0~ds (built using 9.7.0~ds-1 and GCC version 15.3.0)