Yes, "somewhere over the rainbow" functions as an idiomatic expression meaning an idealized, often unattainable place of happiness or peace—existing only in dreams or imagination.
Example: "After losing his savings, Bob dreamed of starting over somewhere over the rainbow."