I've just joined this forum because I have exactly the same situation and you good people are all clearly extraordinarily bright.
My project ends at bar 27, but Sonar X2 keeps going until bar 93. I tried everything advised here and more before I resorted to the internet search that led me to you. There is nothing, nada, zero, zip beyond bar 27. I've done a split at bar 27, selected everything -- all 22 tracks -- from 27 through 93. But Sonar won't let me cut anything -- the cut option on the menu is grayed out. Because there's nothing there. OK, so what, you might reasonably say. Minor inconvenience. Au contraire. Because I export my Cakewalk (excuse me, I mean Pro Audio, no, I mean Sonar -- I've been using Cakewalk/Pro Audio/Sonar since it was nothing but MIDI in a DOS version -- but I digress).
Anyway, I export my Sonar files in XML, which I then import into Finale to distribute scores to singers. Here's where it gets nasty. Finale imports all 93 measures from the XML file Finale. And Finale also says there's nothing there, and it won't let me delete those measures. The "delete measures" option is grayed out, just as in Sonar. Finale, like Sonar, doesn't think those measures exist.
(Now maybe there's some hidden factor lurking. This 27 bars is saved from an earlier project originally created in a much earlier version of Cakewalk. But that earlier project is 120 bars, not 93 bars)
Halfway through writing this, I finally had the brainstorm to resolve it by copying just those 27 bars to a brand new, virgin file. And that fixed it. But I had to go into each track and individually set it to a new softsynth I had to re-create in the new file. Now that truly is a minor inconvenience which may render this whole problem too trivial to trouble you good people.
But I've got other files like this one, and besides that, I'd like to understand what's going on.
Anyway, thanks for any insight you can give me, or, failing that, for letting me vent about the six hours I've just spent trying to figure this out.