Sleeping villagers exit their beds when their job block is removed
The Bug:
Sleeping villagers exit their beds when their job block is removed.
Steps to Reproduce:
- Place down a bed along with a job block that villagers can assign themselves to.
- Summon a villager and allow it to assign itself to the job block.
- Set the time to "night" and wait for the villager to enter its bed.
- Break the villager's job block and watch the villager closely as you do this.
- Take note as to whether or not sleeping villagers exit their beds when their job block is removed.
Observed Behavior:
Sleeping villagers exit their beds.
Expected Behavior:
Sleeping villagers would not exit their beds when their job block is removed.
Created Issue:
Sleeping villagers exit their beds when their job block is removed
The Bug:
Sleeping villagers exit their beds when their job block is removed.
Steps to Reproduce:
- Place down a bed along with a job block that villagers can assign themselves to.
- Summon a villager and allow it to assign itself to the job block.
- Set the time to "night" and wait for the villager to enter its bed.
- Break the villager's job block and watch the villager closely as you do this.
- Take note as to whether or not sleeping villagers exit their beds when their job block is removed.
Observed Behavior:
Sleeping villagers exit their beds.
Expected Behavior:
Sleeping villagers would not exit their beds when their job block is removed.
Added Attachments:
Added Affects Versions: 1.19.4
Added Affects Versions: 1.20
Added Affects Versions: 1.20.1
Added Affects Versions: 24w10a
Added Affects Versions: 1.21
Added Affects Versions: 1.21.4

Intended. Imagine you lose your job! You would be shocked. The shock wakes the villager up.
You need a Mojang source for a WAI, especially with a excusive explenation like that.
I can confirm the behavior; the villager immediately wakes up in a state of shock.
Can confirm in 1.19.4