Problem at bottom of threaded stem
If this is a quill stem—with both a horizontal member and vertical member that fits in the steerer tube—the part that fits in the steerer tube will have either a wedge or expanding bolt at the bottom, which is how it locks inside the tube. You need to loosen this at the top of the stem and make sure the wedge/bolt is loose at the bottom.