If you destroy all beds in a village and villagers were connected to a workstation, destroying workstations won't make the villagers lose their jobs. However, it will not be posible to trade them.
Steps to reproduce.
In a village, destroy all beds without destroying workstations.
Destroy workstations.
Attachments
Comments 2

I consider this to be a useful feature. For example, it allows you to make farmers that will farm crops during 100% of their work schedule without pausing to use the composter.
You can still get them to lose their profession again by placing a bed and workstation, waiting for them to link, and then breaking their workstation again.