lnt --config ~/.lnt/stgconf view channel --max pending_htlcs throws an error when attempting to sort by pending_htlcs.
It appears to be related to the following line
sorted_channels = sorted(channels.items(), key=lambda kv: kv[1][sort_key])
Interestingly enough, when checking the value associated with the key pending_htlcs, every value returned was an empty array, so this may be a little bit more difficult to isolate.
For now I'm going to disable sorting by pending_htlcs. however if this is a commonly requested feature I'll revisit this.