How far can a villager detect a bed?
A villager will claim a bed if: They are within a 48 block sphere of the bed.
First, you need to slightly adjust how you think about villagers detecting POI blocks (beds and workstations for our purposes). Without going down the technical rabbit hole, think of it as follows: A villager can only discover POI blocks that are within 16 blocks horizontally and 4 blocks vertically of their position.
We normally expect villagers to claim beds and workstations in a range of 16 blocks horizontally and 4 blocks vertically. However, the next villager in the queue for a workstation is able to connect to a workstation within16 blocks horizontal and 4 blocks vertical of any villager in that village.
They don't. Iron doors don't count as valid doors in a village, since villagers can't interact with them.
Do villagers really despawn without beds? Villagers have no where to go if you break their bed. They tend to panic at night and die due to a zombie attack. Villagers don't breed unless there is an open bed.
The simulation distance control appears in the settings page when creating a new world. The values that can be set range from 4 to 12 in increments of 2 (even numbers only).
Villagers claim one bed and one workstation each, and can go quite a way to return to them. Only if their originals are broken or inaccessible (and time for work or sleep came, respectively, and they failed to pathfind to them) - and there are new, unclaimed ones available, they'll take them. SF.
Breeding. Even though it may feel like they do not do anything, they can still breed like regular villagers. Players can easily create a villager breeder where they use only nitwits for breeding.
These need to have at least four blocks of floor space each: Two for a bed, one for a job site block, and one for the villager to stand. The open space should be between the head of the bed and the fence gate.
There must be at least one bed for each villager, and each bed must be reachable by some villager. If there is an excess of beds, villager breeding commences.
Do villagers go to the nearest bed?
A villager can only lock onto a bed when they are within 50 blocks of a bed but will stay locked on to a bed within 100 blocks of it. At night, a villager will try to move towards its bed to sleep (no matter how far away the bed is within 100 blocks and no matter if the bed is inaccessible.
Zombies can break only the top half of a door, meaning they cannot break a door if the zombie is facing the bottom half of the door.

To breed villagers in Minecraft, you need to have at least two "willing" villagers and at least three beds. You can increase your villagers' "willingness" to breed by giving them food.
Spawning requirements
Villages attempt to spawn iron golems around the village center when the following requirements are met: The village contains at least 20 beds. The village contains at least 10 villagers.
Villagers can die in all sorts of ways. They can be struck by lightning, turned to witches, murdered by hostiles, suffocated, starved to death… the list goes on.
Villagers can unlink from Workstations if the Village is in 2 chunks when the Host leaves the Game or Switches Dimensions.
Description. Villagers keep stealing beds even though they have already claimed a bed. They also cannot find a path to there bed or workstation in their house even though there is a door.
Infinite Worlds are not really infinite, just so large that they cannot ever be fully explored.
The maximum height a player can possibly reach is Y=2,147,483,647, which is the largest value of a signed integer on a 32-bit system. Beyond this limit, the game may become unresponsive or even crash. The highest achievable height in Console Edition is y=511 due to an invisible wall.
Fill command can't place blocks in the void or beyond the world limit. It can place up to 32,768 blocks at once.
Can villagers climb stairs to get to beds?
Will Villagers use stairs? Yes, Villagers can use stairs, however, Villagers are not good at using one-wide stairs, spiral stairs, or stairs that have less than 3 blocks of space above them.
If there is no space on the side of the bed and there is less than two blocks above the bed, then the player still wakes up on top of the bed, but suffocates if it's a solid block. Villagers always wake up on top of the bed, meaning they can suffocate if there isn't enough room above the bed.
To briefly answer your question, No they do not need beds to restock. They do need beds to breed and reproduce though. However, since your question is about restocking, nope they do not need beds. In order to make a villager restock his trades, all you need to do is give him prior access to a job block.
A Nitwit is a villager who has no profession. Once a child grows up after 5 or 6 days it is automatically turned into a nitwit. Nitwits serve no daily functions in your village.
Nitwit has higher rate to summon Iron Golems when hurt by other mobs.