Does labor mobility create a certain type of market failure? Oxford professor Ewart Keep writes in a paper titled Market Failure in Skills (p. 3) that


  For firms there is the
  problem of investment in
  staff who may leave taking
  their skills with them.


Some of the historical solutions to this problem involve limiting the mobility of the labor force, ranging from slavery, indentured servitude, and more recently some kinds work visas that are only valid for one employer.

So in this sense, some human rights are bad for markets, leading to certain kind of market failure. Is this view uncontroversial among economists? And a complementary question: can measures that limit worker mobility also result in other way in market failure?
Well, from the same paper (p. 5), it's not all that clear that the theory translates to actual market failure:


  There is very little reliable data on either the scale of
  poaching or its impact upon employers’ training
  decisions – despite this being frequently adduced by
  policy makers as the prime cause of market failure in
  training. One of the few recent surveys to touch on the
  issue (4) suggested that poaching was a serious problem
  for no more than about one per cent of the employers in
  the sample, whereas an earlier survey of employers
  suggested that the possibility of poaching had
  discouraged as many as 38% from investing in skill (5).


The references cited for data being:


  (4) J. Kitching and R. Blackburn. 2002. ‘The Nature of
  Training and Motivation to Train in Small Firms’, DfES
  Research Report RR330, Nottingham: DfES.
  
  (5) Training Agency. 1989. Training in Britain, London:
  HMSO.


I think this constitutes a partial answer, but I'm quite interested in more data, in particular from other countries.



And, yes, as I suspected, labor immobility is also a form (perhaps less controversial) of market failure. But this does in turn raise the interesting question whether you can fix one market failure without causing another (in the labor market).