I start by saying that I have posted a similar question a few years back, but now I have refined the question a bit more. I have stumbled on this working in finite group theory. The question reminds me a lot Freiman theorem in additive combinatorics.

Let $n$ and $\ell$ be a positive integers and let $L$ be a subset of $\{1,\ldots,\lfloor (n-1)/2\rfloor\}$ of cardinality $\ell$ with $\ell\ge cn$. Here $c$ is an absolute constant which does not depend on $n$ or $\ell$. (I have little information on the actual value of $c$.) Let $$B:=\{(x,y,z)\in L\times L\times L\mid x<y<z, x+y=z \textrm{ or }n-(x+y)=z\}.$$ What can be said on $L$ if $|B|> \ell(\ell-1)/4$? Is the set $L$ special, in some arithmetic sense?

Observe that the definition of $B$ reminds a lot the definition of additive energy in additive combinatorics, see for instance the book of Tao and Vu.