Airplanes do sometimes transport human remains in caskets and do not contribute to the count of souls on board. FAA Advisory Circular 150/5210-7D (Aircraft Rescue and Fire Fighting Communications)[0], for example, defines souls on board as “total number of passengers and crew.”
If the pilot says "50 souls on board", but is also transporting 2 cadavers, and the rescue team finds 50 bodies before giving up, it's possible there'd still be 2 people alive when they gave up.
[0]: https://www.faa.gov/documentLibrary/media/advisory_circular/...