Do 形声 words have an approximate or historical phonetic part? There are many examples of 形声 compounds that have a phonetic component that does not match the pronunciation of the word. Some examples are the 鬼 in 愧, the 其 in 基, or the 白 in 泊. Are these incongruences the result of a change in pronunciation but invariance in writing? I think this is the case for 泊, because I read somewhere that 百 used to be pronounced bo, and maybe that's the same for 白 as well.
Is that the case, or are some of these approximations where the pronunciation compromises for a hint at meaning? For example, maybe the rationale is that 愧 means shame and 鬼 scare people, and shame and fear are somewhat similar.
What about 形声 compounds that have an accurate (in regards to the modern pronunciation) sound but different tone? One example is the 尤 in 优. If the answer is that they're historical, does that mean 优 used to be pronounced yóu?
Most characters in use today were created by the Qín Dynasty (over 2,000 years ago!), so the modern mismatch between the phonetic component and the sound is indeed due to a change in pronunciation but invariance in writing.


are some of these approximations where the pronunciation compromises for a hint at meaning?

If sound components were selected for their meaning, we should be seeing examples of variant characters where similar sound components were interchangeable, but with one of the variants surviving because the sound component's meaning matches the character better. AFAIK, we're not seeing examples like this.
Most of the time, when you see explanations where a phonetic component is said to impart meaning, that is because the phonetic component was either the original character or at least was an essential pictorial or ideographical part of the character.
For phonetic components which were the original form of the word they represented, these were often later complexified through the addition of a semantic component, because the original character's uses had broadened or has been lost. For example,

「益」 picture of water 「水」 overflowing in a vessel 「皿」 &gt; overflow/spill. This is now written as 「溢」.

「益」 itself has been semantically extended to mean abundant.


「申」 picture of a bolt of lightning. This is now written as 「電」 (Baxter-Sagart OC: /*lˤi[n]-s/).

「申」 itself is now a phonetic loan for ninth earthly branch (/*l̥i[n]/).


「然」 to burn/immolate, from semantic 「灬・火」 (fire) and phonetic 「肰」. This is now written as 「燃」.

「然」 itself is now purely a phonetic loan, taking on a bunch of unrelated auxiliary meanings.


「原」 water source, from a picture of a mountain cliff 「厂」 hanging over a simultaneously semantic and phonetic 「泉」 (water spring). This is now written as 「源」.

「原」 itself has now been extended to mean source/origin in a more abstract manner.



For phonetic components which were essential pictorial or ideographical parts of the character, their phonetic contribution was likely of secondary importance; substituting these components for just any similar-sounding component would likely break the character entirely. For example,

「有」 (/*[ɢ]ʷəʔ/, to have), picture of a hand 「又」 (also /*[ɢ]ʷəʔ/) holding a piece of meat 「肉」.
「員」 picture of a cauldron 「鼎」 with the shape of a circle 「〇」 near the opening &gt; round, now written 「圓」.
「字」 (/*mə-dzə(ʔ)-s/), a picture of a child 「子」 (/*tsəʔ/) being born &gt; newly-created Chinese character from existing characters &gt; Chinese character;
「青」 (/*[s.r̥]ˤeŋ/, colour of green plants), from picture of a sprouting plant 「生」 (/*sreŋ/) and phonetic 「井」 (/*C.tseŋʔ/).



For example, maybe the rationale is that 愧 means shame and 鬼 scare people, and shame and fear are somewhat similar.

Generally, if meaning connections are too vague, they cannot be practically used to refer to a concrete word, otherwise anything can mean anything. If you find an explanation that is stretching the meaning of a component to fit the character, it'll be better to discard that component's meaning and to take it on a sound-hint face value.