“apt can struggle with ordering when handling the massive Y2028 time_t transition when upgrading to Ubuntu 24.04 LTS.
It was identified that dropping the libglib2.0-0 transitional package can help apt do things in the correct order.”
Sounds like an apt ordering issue which has been worked around by dropping a package which was causing it to incorrectly order. The failure of snapd was a symptom caused by the error in apt.