If it can help, I've been looking into my save file to see what is wrong; especially why we can't buy new animals when the barn is considered empty. For anyone who knows any XML it might be helpful, otherwise I am hoping it can at least reach the dev.
Looking into the Barn building, I have the list of id of the animals living in it:
XML:
<animalsThatLiveHere>
<long>1573324329037581224</long>
<long>1573324455672007593</long>
<long>1573324577575259050</long>
<long>1573324714041133995</long>
<long>1575078956573641673</long>
<long>1575079106159299530</long>
<long>1576469623749200866</long>
<long>1586339517248555810</long>
<long>1586555772878441252</long>
</animalsThatLiveHere>
Yet, a quick search into the save file shows that those id are nowhere to be found anywhere else. So my assumptions is that those entities got deleted from the save file with the bug, but since the game files still references 9 animals (for me), the game considers I have 9/12 slots used still.
Another issue I noticed, which is quite strange too, is that the game considers I have currently 6 occupants in the barn...
XML:
<maxOccupants>12</maxOccupants>
<currentOccupants>6</currentOccupants>
This is my first time analysing the save file so I might be wrong in my assumption, but it does seem strange to have 9 in the list of animals but 6 as the current occupants.
For my coop, with my chicken still existing, I could find that list of <animalsThatLiveHere>, and a quick search on any of the id would return me multiple results, aka they are well declared in my file. The number in currentOccupants also matches with the number of id in the list.
For anyone who want a quick fix, /!\ Backup your save file first /!\ what seemed to work for me is to delete all the long in the animalsthatlivehere list and change the currentOccupants to 0. Sadly it doesn't bring them back but at least you can buy new ones again... I played two days after this change and so far I haven't found anything broken in my save and the animals haven't disappeared again (I closed the barn and coop now haha). Hopefully it stays like this!