Having looked at the error message and reviewed BDS-11039 (BDS-11039) I decided to try rebuilding a village that was destroyed and making sure that all villagers are near a village with enough beds for each villager. It might be coincidence and we've only played for an hour but we've not yet had a crash with this error message since.
@Jam approximately 5 hours of play since villagers had somewhere to sleep again and no server crashes to report. Hope it is something that can be fixed as easily as moving the null-pointer check and that it can be fixed across the whole code-base so that we don't find it elsewhere.