BUG: loc assignment with astype buggy, (GH5702)

closes #5702