It is of course possible, given a certain technological leap that is at present, beyond our knowledge. Namely, creating a discrete and localised energy field. You're basically asking a variant of the laser sword / light sabre question: how do I get an energy field that's three foot long and about two inches in diametre.
You've handwaved that the tech exists, thus, the sword itself can be made. The question really boils down to will this be effective as a sword. You mention some potential issues:
The sword is able to effectively cut and pierce targets. I'd argue that your weapon will likely not do either of these. As we all know, magnetic fields are compressible -- you can squeeze two SN-NS magnets together until they are quite close together. If you try to stab or slice someone with your weapon, all you're going to end up doing is squashing the field and thus bringing the shards in close proximity. Pushing / stabbing harder may cause the shards to more or less explosively be thrown from the field matrix. This bodes as well for the wielder of the sword as it does for the intended victim!
Sometimes, azkabantium flakes break loose from the blade and get stuck in the target. This, of course, is perfectly fine and not an issue. Consider ancient Aztec swords: bits of obsidian held within a wooden matrix. The main issue with your magnetic sword is that you're unlikely to get those shards much more than about skin deep. An annoyance, to be sure, but unlikely to cause more than irritation.
The blade of a regular sword will pass through a bound sword's. Yes, if your foes are fighting with bronze or stone weapons. Obviously, your magnetic sword wielders will have to take this into account as they develop their martial arts techniques. They can not rely on their own swords as defensive weapons. On a positive note, this can act in their favour, because their enemies have all trained with physical swords and most likely their muscle memory will cause them to overbalance and react inappropriately to your sword. However, once iron and steel swords are developped, you'll find that your enemies' blades will simply be caught in the field matrix, right along with your shards! This could be very interesting indeed!
If a bound sword's blade is disturbed, it returns to normal, given some time. Shouldn't take much time at all: compressed magnets will seek equilibrium as soon as the compressing force is released.
While I think a magnetic sword with bits in it is doable, I don't think it will be an effective weapon. I would suggest that in stead of a sword, you develop a kind of morning star or cat-o-nine-tails weapon. Something that relies on splatting or semi-passively slicing him, rather than actively stabbing him. Also, a whip-like weapon could be used to capture and enemy's (iron) sword before he can close in.