患得怨失
[huàn dé yuàn shī]
It can be understood as complaining when you get something and regretting it if you lost it, expressing a complex feeling towards gains and losses and revealing the mentality and emotional fluctuations of pursuing and missing things, including anxiety about obtaining and loss aversion after losing