Hi,
I kept goldfish for many years until last year. In the event of a goldfish being "off form" but with no specific diagnosis able to be made, I used aquarium salt - one dosage of that was often enough to rectify the situation within 24hrs. However, as the fins and tail are closed, there isn't much swimming and it's hovering near the top of the tank, it does seem as though the fish needs something more than that, so the suggestion of using eSHa 2000 is a wise and better option in this case.
In terms of objects in the tank, that alone won't be the reason but it may be a small part. If you do get more objects, then I'd advise NOT getting something where there are holes that are slightly smaller than the goldfish - traumatic for fish and owner when the fish squeeze into and get stuck in them (writing this from experience).
Presumably the 3-litre container is what you were planning while medicating the sick fish on its own? Many years ago, I moved a sick fish into a similar-sized container with no filter to medicate, and it didn't survive more than an hour; even last week, I moved a tiny pygmy cory (just over 1cm long) into a 6-litre container and it was struggling before 2hrs had passed.
Goldfish need very large tanks (140+ litres per fish, 180+ litres for two) otherwise the water quality becomes impaired (to such an extent that daily water changes are necessary), leading to an early demise or chronic illnesses. If you don't already have this, then I'd advise upgrading to this or as close to this as you can possibly manage - as soon as possible. They can be bought second-hand on gumtree/ebay, etc, at reasonable prices. If the move for the goldfish is only temporary (eg a few months), and you plan to return them into the pond if/when they are faring better, then you can buy large, plastic storage boxes of ~80 litres from various homestores - a filter will attach to the side of them, and this is as good as a tank of that size and better than a smaller tank, as well as being very affordable.
Hope this helps. Best of luck!