As RedCorvette suggests, magnetism can be induced. You can create a magnet easily by banging an iron rod with a hammer while it is aligned North/South. Students do this with a needle and stick it into a floating cork to make a primitive compass. Battleships magnetize their entire structure when they fire their guns repeatedly, and end up requiring degaussing. A shroud or stay could get magnetized from vibrating in the wind or from being "strummed" against by another line or halyard. Stainless is theoretically less magnetic than solid iron, but it still has iron in it. Even if you replaced the magnetized wire with a new, nonmagnetized section, who's to say the new piece would'nt become magnetized later, if that's what happened to the first one? For the owner, the best solution may be a good compass adjuster.