BUG: Fixed an issue with a duplicate index and assignment with a dtype change (GH4686)

closes #4686