Sanitizing user form input in php
I am concerned that you are not digesting the advice given in previous reviews, because you are ONLY to call htmlspecialchars() just before you print to an html document (print to screen).
Effectively, you only need to handle whitespace related characters.  Since you seem to be concerned with handling multibyte characters, the unicode flag should be used on your regex patterns.  See this relevant SO page: Multibyte trim in PHP?
$stmt-&gt;execute([
    'message' =&gt; filter_var(
        preg_replace(
            ['/^\s+|\s+$/u', '/\s{2,}/u'],
            ['', ' '],
            $_POST[&quot;message&quot;]
        ),
        FILTER_SANITIZE_STRING
    )
]);

If you are using FILTER_SANITIZE_STRING to strip tags, please see some potentially buggy behavior in the comments at https://www.php.net/manual/en/filter.filters.sanitize.php
P.s. I'd probably not use a named parameter in the prepared statement; there is only one bound parameter so there is no chance of confusion.