According to the Minecraft Wiki, the villagers need unclaimed beds available within the limits of the village to breed successful.
However, currently they seem to need a direct line of sight to an unclaimed bed, or they quit the breeding after a few seconds with anger particles, although enough free beds are within the boundary of the village.
Linked issues
Attachments
Comments 3

The wiki does however state its official.
I have testet breeding between two villagers who dont have line of sight to their own beds or to an unclaimed bed but are able to pathfind to them. They bred fine.
[media][media]

Can this still be reproduced in the latest 1.16 snapshot?
Works as intended I believe, don't trust the minecraft wiki on everything, it's not official.