Not sure if this is a bug but the sell priority goes from the higher number to the lowest. I believe it should be from the lowest so an item with sell priority 1 should be sold first not last.
I built something with a lot of ult duration upgrades and the bar gets to 1/4th left of the animation for the ult and then stops, it might just be a fail-safe to make sure the ult doesn't last past a certain time, but it might be a bug. video attached to demonstrate.