The risk reduces a lot if you prepare before switching. Learning basic skills, taking relevant courses and doing small projects in the new field make the move smoother. When you can show some practical work, employers take your change more seriously.