(Here I'm trying to show why 四方を海に囲まれる is not direct passive. Please see this as an appendix to broccoliforest's answer and reply to KentaroTomono's comment.)
First, OP's second sentence 四方が海に囲まれる is direct passive.
Wikipedia defines「直接受身は、能動文における直接目的語または間接目的語を主語にするものである。」(source). Following this definition, a direct passive sentence is formed this way:
The active sentence 海が四方を囲む has a direct object, "四方を".
Use the 四方 as the subject in the direct passive sentence.
You get 四方が海に囲まれる。
Therefore, 四方が海に囲まれる is direct passive.
Now, this page says the possessor passive is something like this:
(1)私は 田中さんに パソコンを こわされた。← possessor passive
cf: (2)私のパソコンが 田中さんに こわされた。← direct passive
#2 has a corresponding active voice phrase: 田中さんが 私のパソコンを こわした。
#1 doesn't have a corresponding active voice phrase.
The phrases in question can be analysed in the same way:
(1)島は 海に 四方を 囲まれる。 ← possessor passive
cf: (2)島の四方が 海に 囲まれる。 ← direct passive
#2 has a corresponding active phrase: 海が島の四方を囲む。
#1 doesn't have a corresponding active phrase.
This shows that 四方を海に囲まれる is possessor passive, not direct passive.
As for the quote from Wikipedia:
また直接受身では、「誰々に」を「誰々によって」と言い換えることができるが、迷惑の受身では一般にこの言い換えはできない。(source)
It says 迷惑の受身ではこの言い換えはできない(the suffering passive can't take によって), not 持主の受身ではこの言い換えはできない(the possessor passive can't take によって). For example, 私は家族を日本兵に殺された, which is possessor passive not direct passive, can be rephrased as 私は家族を日本兵によって殺された. So you can't conclude that 四方を海に囲まれる is direct passive just because you can rephrase it as 四方を海によって囲まれる.
The conditions of the Japanese direct passive voice are:
①対応する能動態がある
②迷惑の意味はない
③英語にある
(source)
First, does 四方が海に囲まれる meet these conditions?
①It has a corresponding active phrase.
→Yes. 海が四方を囲む.
海が四方を(object)囲む。→ 四方が(subject)海に囲まれる。
②It doesn't have a meaning of suffering.
→No. The subject 四方 doesn't suffer from being surrounded by the sea.
③There is an equivalent passive phrase in English.
→Yes. "The four sides are surrounded by the sea."
(Not "The sea encircles all directions", which is active voice.)
It meets all these conditions. Therefore, 四方が海に囲まれる is direct passive.
Now, does 四方を海に囲まれる meet these conditions, too?
①It has a corresponding active voice phrase.
→No, it has no corresponding active voice phrase.
②It doesn't have a meaning of suffering.
→No. In 島は四方を海に囲まれている, for example, the island doesn't necessarily suffer from being surrounded by the sea.
③There is an equivalent passive phrase in English.
→No, there is no equivalent passive phrase in English.
It doesn't meet ① and ③. Therefore, 四方を海に囲まれる is not direct passive.
Is 四方を海に囲まれる possessor passive, then? Here's the conditions of the possessor passive:
①対応する能動文がない。
②動詞によっては必ずしも迷惑を表さない。
(source)
Does 四方を海に囲まれる meet these conditions?
①It doesn't have a corresponding active voice phrase.
→ No, it has no corresponding active phrase.
②It doesn't necessarily indicate suffering, depending on the verb used.
→ No. In 島は四方を海に囲まれる, for example, the island doesn't necessarily suffer from being surrounded by the sea.
It meets both of these conditions, so 四方を海に囲まれる is possessor passive, and not direct passive.
Hope this helps.