Not an answer but just trying to clarify the question, are you referring to the Courland pocket?
I can’t really specify why the Germans (and their allies/collaborators) were able to hold out in terms of their own determination, strategy or supply situation, I can speak to why the Soviets let them hold out: the simple fact that Berlin/Germany was the priority.
We see long “sieges” on both the Eastern and Western fronts of the European theater, and even the Pacific theater. When your strategy is to get to the enemy heartland as quickly and efficiently as possible, you don’t necessarily worry about isolated pockets that pose no major strategic threat. In France, the city of Brest held out for a very long time against the Allied forces. But that wasn’t because the Allies couldn’t take it, it’s that it wasn’t the priority. Brest is a coastal town with a port, so it’s certainly valuable. But, Brest is West of Normandy (Germany and all major objectives were East from Normandy), and at the tip of a Peninsula (Allies Control the Atlantic, so very limited chance of escape/resupply). So not a major priority and not a major threat. Therefore the best strategic option for commanders in “dealing with Brest” would be containment. Keep them blocked in, shell/bomb them occasionally, but don’t waste men and supplies on a secondary/preferential objective when the real threats and actual objectives are somewhere else. Brest is just an example, but like I mentioned before, there were similar occurrences in the East and the Pacific. There were islands in the “island hopping” strategy that didn’t serve much strategic value, and so once we destroyed the capability of the Japanese Navy to resupply these places, we simply sailed around them. That doesn’t mean attempts to take these islands were never executed, but they weren’t major operation occasions like Palau, The Solomons, Saipan, or Iwo Jima.
So to circle around and answer your question about the Courland Pocket in Latvia, it comes down to Soviet priorities. In a mirror image to the Germans besieging the Soviets at Odessa and Sevastopol in Operation Barbarossa, the Soviets didn’t let pockets on the coast prevent them from pushing further towards their main objective: Berlin.