The Bars command will always draw the bar based on the row number in the data table.
For example, here is some data.
If the Bars command is used with a Split axis and a mask for each group (a or b) you get something like this, which sounds like what you are seeing.
There are two other commands that draw bars and give you more control over the location. One is the Bar command. The other is the Pivot command.
Here is an article that compares all three: How to make a Bar Graph
For example, to use the Pivot command in this case …
1 – Select the columns Sample and Data
2 – Click the Pivot command shortcut
3 – In the new command, apply the mask
4 – Make a copy of the command and edit the mask as needed
5 – Split the Y axis and place one on each axis
Then you can get something like this …
In this example, the X tick mark labels were also changed to Categories and Labels = #, to show the row number rather than the sample number.
Does this help?