first of all, dont panic!
they will build their trust up again, and will lay again I'm certain
they may be traumatised by the magpies, which will make them scared with you too, and maybe something has been in the house that they dont like?
where do you feed them? you could maybe encourage into the house by placing the food closer & closer to the house each day & then inside?
is the bedding material different?
if they are "POL" then they are still getting the hang of it (!) so egg lating may well be erratic for a while.
(It is with ours, and one still lays outside sometimes - like its taken her by surprise!)
as for deterring magpies... I cant help - short of trapping or shooting them (which will scare the bejezzus out of your timid ducks!!)
ours are in a covered pen, mainly because of foxes & loose dogs, and they chose to sleep outside anyway.
good luck anyway
