I've seen it mentioned in a post and on reddit, but it hadn't happened to me back then, now it did.
My Settlers of Sanctuary Hills behave normal during the day, but at night, just before they go to sleep, they all gather behind the house with the workshop. All of them with the exception of the guards, companions included. They stand there and do nothing, just look very strange. Someone mentioned it might be a pathing issue and that they don't know how to reach their beds but, when it's bed time, they all go to them as they normally would.
I placed a large shack where they gather to make it seem like it was just their meeting place after dark, where a bunch of awkward settlers would hang out, and then they started to pretty much teleport from there to somewhere else, probably their beds.