Well, in OTL everything went wrong by a set of really foolish reasons. Well before the war Russia had an effective set of the agents both in China and Japan and at the early stage of a war one of the top figures clearly explained that it will make sense to stick with Japan because it is going to be a leading factor in the region. In other words, just not change anything and you’ll be OK: China after the Ili crisis was not considered a friendly state but relations with Japan had been quite cordial. So, basically, the winning scenario was: do nothing.Good to See that Russia planned this through
When S-JW started, AIII died. And Nicky found himself surrounded by the people who were more experienced in pretty much all areas. So it was reasonable for him to listen to their opinions. But even being brilliant does not automatically mean making the right decisions. Witte considered situation from a financial position and it seemingly made sense to provide China with a loan to pay war indemnity to Japan in exchange for getting concession on construction of the East-China RR. Which also seemingly made sense both by providing a nice shortcut to Vladivostok and by ability to get money for transporting cargo across Manchuria. Of course, abandoning Russian route (TransSib) meant that the Russian territory will not be developed but when you are putting the finances first these considerations do not matter. The next step was also “logical”: if Russia is already close, why don’t “lent” Liandong peninsula and turn it into a commercial terminal and naval base? On this move NII was encouraged by combination of Cousin Willy, Witte, and naval leadership. Willy wanted Russia to get stuck on the Far East, Witte was dreaming about competition with the major Chinese ports and the naval personages bought an idea of the “warm water port”. Of course, taking into an account that just recently Russia and Germany forced Japan to leave the peninsula, Japanese reaction had been 100% predictable. Anyway, the Russian money lent to China had been used to built a modern Japanese navy but if the peninsula was left in Japanese possession, a noticeable part of that sum would be spent upon improving ports of PA and Dailan and building fortifications. BTW, with the unknown amounts spent on Dalnij (which did not become what it was expected to be), PA never got anything close to the money and other resources needed for the adequate fortifications but this was not exactly problem of the Finances Ministry.
Boxer rebellion resulted in a serious dislike of the Russians by population of Manchuria and resulting need to keep troops guarding East-China RR, which caused international tensions and strengthened the British support of Japan. And, because, when you start doing something stupid, it is hard to stop, it was reasonable to extend the RR all the way to Korea, which was Japanese protectorate.
But none of the above would have to happen with a little bit of a foresight and even proper consideration of the known facts so I’m just trying to minimize amount of the OTL idiocies to an acceptable level. 😉