Downgrade to a Palindrome Given a string s, return the smallest contiguous substring you can remove to create a palindrome.

Examples:
800233008   -&gt; 2
racecarFOOL -&gt; FOOL
abcdedcba   -&gt; (empty string)
ngryL Myrgn -&gt; &quot;L &quot; (or &quot; M&quot;)
123456789   -&gt; 12345678 (or 23456789)
aabcdbaa    -&gt; c (or d)
[[]]        -&gt; [[ (or ]])
a           -&gt; (empty string)

Test case suggestions from users (if you find an edge case not listed, please post a comment):
aabaab      -&gt; b    | Suggested by Zgarb, some returned &quot;aa&quot;.


Rules

Only printable ASCII characters will appear in the input (no newlines, keep it simple).
Not really a rule, but note &lt;&gt;, /\, (), [] and {} are not palindromes.

This is code-golf, smallest byte-count wins.

+100 bounty has been claimed by Adnan
J, 24 bytes

(0{::(-:|.)\.#&amp;,&lt;\)~i.@#


Try it online!

Explanation

(0{::(-:|.)\.#&amp;,&lt;\)~i.@#  Input: array of chars S
                       #  Length of S
                    i.@   Range, [0, 1, ..., len(S)-1]
(                 )~      Dyadic verb on range and S
           \.               For each outfix of S of size x in range
        |.                    Reverse
      -:                      Matches input (is palindrome)
                &lt;\          Box each infix of S of size x in range
             #&amp;,            Flatten each and copy the ones that match
 0{::                       Fetch the result and index 0 and return