What are the possible reasons why Hyper-V can't compact a VHD?

Remove the shadow copies from the guest. That will do it!

vssadmin delete shadows /all

In the interest of Internet search consolidation: Eventually found this link thas an approach that has worked when HyperV compact did not: https://fiddley.wordpress.com/2014/01/27/dynamically-expanding-vhd-not-compacting-in-hyper-v/

In Administrative command prompt, run DISKPART

At the DISKPART command prompt

select vdisk File=”I:\path\to\your.vhd”
attach vdisk readonly
compact vdisk
detach vdisk