I just went through weeks of back and forth with Lionel on this same issue. I have 10 sensor tracks on my layout, wifi module, 4 ASC2, 2 BPC2. I had sensor tracks that did the same as yours. Also ones that would do the wrong command that was programmed, or do the command in both directions when it should not. We tried new legacy Base, new cables (changed from 20 ft to 10 ft), eliminating the ASC2 and BPC2 from the mix, etc.
The final cause : multiple defective sensor tracks. Out of 10 I had on the layout 3 were defective. The problem was that when I got to one and I thought it was bad, I would switch it with another and that one was bad too(dumb luck) so I assumed it was not the tracks since I did not think 2 could be defective. I had to tear up my whole layout to start from the first track and hook up one after another to narrow it down. I was not a happy camper. When I got to one that did not work, I would take the one right before it that I knew did work and try it in that spot and it would work, so I knew it was the track (and not a cable or something). That's a 30% failure rate in my case, not very good. The problem is you don't know if its the track you are putting in, the cable between the tracks or even the output port of the track prior to the one you are putting in. So for each one you have to go step by step looking at 3 things. I also found out from service I was almost at the max modules that the power supply could handle and they thought it might be a low power situation, but they have no solution, as there is no bigger power supply or a way to hook up 2 power supplies. Luckily that was not the issue.
I am using the LCS system to do everything by command, but it seems it was not designed for layouts with a lot of modules. I may need to add another ASC2 so hopefully I won't run short of power.
Apparently the way it works is when the engine passes over the sensor, the track sends the command through the PDI chain back to the Legacy base which then sends out the command to the engine. It would be just like it was coming from the CAB2. A bad track and the commands get all messed up. So if you can do things like blow the whistle from the CAB2 on the same section of track then its not a Base to Engine issue, its a sensor track issue.
I got almost all mine from the last batch that came in, so not sure if there is some issue with the last run of sensor tracks.
My advice is do not permanently put anything down on your layout until you test all commands one by one on each track. Also, apparently there is some hardware issue (they did not share the details) and in some cases you may need a filter (from Lionel) if you have an issue where Record Ready mode drops out before the recording starts. Lionel has a fix, which is a filter you plug into the last module of the chain.
Every LCS module I installed up until the sensor tracks worked perfect. I just spent a month trying to figure out what was happening. Luckily I have a LHS to go exchange tracks but if you are a mail order person, its going to be a bigger pain.
I now have all 10 working.