My local BMW shop (BMW of Detroit) had no problem finding a 2018 software update existed but hadn't been applied to my 2012 K13S. He installed it and for a few hundred miles I thought it was the solution. But then the stalling started happening again.
the electronics on these bikes is out of the ark and too stupid to know you are playing - and I think I have a workaround for you
My 2007 R1200 GS is doing something silly and what you describe is somewhat similar - Note the K1300 and R1200 range run MUCH the same software, wiring and electronic modules (in fact the engine ECU is the same, and its also used on some of their cars!)
its probably a bit of time driven junk software that makes it deliberately run badly - then you pay for diagnostics / updates - and whilst waiting ride the illegally modified latest bike - and the thing is such a transformation you dump yours and buy the new bike - Its called German marketing. For the doubters I don't care the facts speak for themself - Note Mercedes have recalls as we speak, to reflash their cars to remove TWO deliberate fake make the engine light come on bugs they built in - they were caught with their pants down, whilst the EU were hunting for and found the emission fiddles they'd put in there!
After the vehicle adaptions have been reset - the bike short term goes in to a special mode where its runs correctly and then starts the process of finding its feet and setting up its long term adaptions - this is the EXACT behaviour I'm getting on my GS and matches what you describe above. But then it goes to utter shit after 200 miles
That long bit I posted earlier about how the bikes CAT sensors work with the engine management and AF-XiEDs came from a guy helping me with my R1200 issue. In the last year I have reset my adaptions 4 times, and it ran the best it ever did - then went to utter shit like clockwork. There are no known faults, just BMW's software. BMW even had a PuMA case on my bike and gave it the all clear
PuMA is a worldwide BMW database of all reported problems and special factory technical support offering their appropriate fixes. The acronym means
Problem and Measures management Aftersales or in German: Problem und Mebnahmenmanagement Aftersales
So how do you resolve - this is super easy (but only sensible if you don't use in a significant range of temps and altitude variations) - reset the adaptions - ride the bike with super unleaded and do four 40 mile trips, riding sensibly the first time and on the third and fourth having warmed carefully for at least 10 miles rag it to death through all its operating conditions - then disconnect the CAT sensor and leave it off for ever more.
the bike will remain running perfectly and far better than when you bought it
the tech guys at work are all like why not just build your own ECU, its all out there, electronics since this shit was developed in 2006 can do it all better faster for peanuts