I too just had a similar experience on Bedrock (Nintendo Switch) since updating to 1.17.30. I didn't leave the area or go to another chunk and after saving and resuming the game the next day, all of the passive mob animals that I had in my barn and castle despawned (cows, sheep, horses, donkey and many chickens). I immediately tried to corral some new animals and those too disappeared. After a few more tries, it seems the animals are staying around for now.. This is the first time this has happened and like everyone else, I assume this is related to the update.
This is happening more frequently since updating to 1.19. In previous versions of 1.18, the freezing on auto save and disappearing blocks/delayed breaking of blocks had improved. This seems to have regressed, as I am seeing the same minute plus freezing on auto save and missing animation when breaking blocks on 1.19 similarly to the initial problems reported in this ticket that have been improved with the various 1.18 updates on the Nintendo Switch.