I find custom bone shape orientation to be one of the more difficult concepts to grasp/teach. Basically, your custom shape origin has to match the origin of your bone, along with the orientation of the bone. Try enabling “axis” display on the control and your bone to guide your orientating process.