Asking for a recommendation letter to transfer PhD programs from someone who I want to be my advisor if I don't succeed in transferring I am a first-year PhD student in statistics, but plan to apply to computer science graduate programs in the fall.  Two of my recommenders, however, are professors who I would like to advise me if I were to stay in my current program.  Because I have a limited computer science background, there is a decent chance that I will not be accepted to good programs and will therefore stay in my current program.  I am worried that this will make it difficult to work with these professors if I do end up staying.

Is this likely to be a problem?  What's the best way to obtain a letter of recommendation while keeping the door open for that person to be my advisor if transferring programs doesn't work out?

Thanks!
Professors are human too. If you stayed within the current program those professors may doubt your level of interest/motivation since you tried to transfer out. I would suggest that you apply only if you're absolutely sure you want to transfer. 

On another note, anecdotally, computer science graduate programs are quite welcoming of people from different backgrounds. In your case, having a statistics background might make you an attractive candidate for machine learning professors. So I would say apply to a broad range of programs including the top programs, you never know what will happen.