Actually you don't have to change the gap limit at all. You can use the following command in the console to get the private key for a specific index:
getprivatekeyforpath("m/0'/50000")
I didn't know about this command. Thanks for sharing that, but I think you should remove the apostrophe after the 0 and the command should be
getprivatekeyforpath("m/0/50000"). Otherwise, you will get an incorrect private key.
Please correct me, if I am missing something.
Thanks, I was surprised to discover this command in the console. Now the OP can easily get access to the address with idx 50000.
To check if the privkey will actually produce the exact address, without needing to create a keystore before, he could type the following command:
bitcoin.address_from_private_key('p2wpkh:KorLxxxx')
'bc1qxxxx'
This command can be useful to check which address the private key produces before even importing the private key into the elctrum's new import keystore.
It also works by changing the address script type, e.g. p2wpkh-p2sh (segwit compatible), p2pkh (no need, as it will generate the legacy address by default).