。
Bitter medicine doesn't necessarily work well.
Literal
Necessarily bitter medicine [subject-が] going-well works [not-とは限らない].
必ずしも...とは限らない is the standard 'not necessarily' pattern, signalling that a generalization has exceptions. The proverbial sentiment — that bitter medicine doesn't always work better — pushes back on the common belief that harshness equals effectiveness. 苦い薬 ('bitter medicine') is a stock image in Japanese for unpleasant-but-supposedly-good things, much like the English 'tough love.'