I made this ebook all by myself, using html, css and so on. It is not a converted file.
If you need a sample, this is the copyright page:
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="it" xmlns:epub="http://www.idpf.org/2007/ops">
<head>
<title>Copyright</title>
<link href="../Styles/style.css" rel="stylesheet" type="text/css" />
<script src="../Misc/kobo.js" type="text/javascript" xmlns="http://www.w3.org/1999/xhtml">
</script>
<style type="text/css">
.koboSpan { -webkit-text-combine: inherit; }
</style>
</head>
<body>
<div id="book-columns" xmlns="http://www.w3.org/1999/xhtml">
<div id="book-inner" xmlns="http://www.w3.org/1999/xhtml">
<h2 title="Copyright"></h2>
<p class="cpr1"><span class="koboSpan" id="kobo.1.1" xmlns="http://www.w3.org/1999/xhtml">Titolo originale:</span></p>
<p class="cpr3"><span class="koboSpan" id="kobo.2.1" xmlns="http://www.w3.org/1999/xhtml">Olalla</span></p>
<p class="cpr1"><span class="koboSpan" id="kobo.3.1" xmlns="http://www.w3.org/1999/xhtml">Pubblicato per la prima volta nel 1887</span></p>
<p class="cpr1"><span class="koboSpan" id="kobo.4.1" xmlns="http://www.w3.org/1999/xhtml">in</span> The Merry Men and Other Tales and Fables</p>
<p class="cpr2"><span class="koboSpan" id="kobo.5.1" xmlns="http://www.w3.org/1999/xhtml">da Chatto & Windus, Londra, Regno Unito.</span></p>
<p class="cpr1"><span class="koboSpan" id="kobo.6.1" xmlns="http://www.w3.org/1999/xhtml">Traduzione integrale dall'inglese</span></p>
<p class="cpr3"><span class="koboSpan" id="kobo.7.1" xmlns="http://www.w3.org/1999/xhtml">xxxxx</span></p>
<p class="cpr1"><span class="koboSpan" id="kobo.8.1" xmlns="http://www.w3.org/1999/xhtml">Copertina realizzata da</span></p>
<p class="cpr4"><span class="koboSpan" id="kobo.9.1" xmlns="http://www.w3.org/1999/xhtml">xxxxx</span></p>
<p class="cpr1"><span class="koboSpan" id="kobo.10.1" xmlns="http://www.w3.org/1999/xhtml">© xxxxx</span></p>
<p class="cpr1"><span class="koboSpan" id="kobo.11.1" xmlns="http://www.w3.org/1999/xhtml">Tutti i diritti della presente edizione sono riservati. Nessuna parte di questo libro può essere riprodotta in qualsiasi forma o con qualsiasi mezzo elettronico o meccanico, compreso lo stoccaggio in sistemi di recupero dati, senza autorizzazione scritta da parte dell’Editore.</span><span class="koboSpan" id="kobo.12.1" xmlns="http://www.w3.org/1999/xhtml">È espressamente vietato trasmettere ad altri il presente libro, né in formato cartaceo né elettronico, né per denaro né a titolo gratuito.</span></p>
<p class="cpr5"><span class="koboSpan" id="kobo.13.1" xmlns="http://www.w3.org/1999/xhtml">ISBN</span></p>
</div>
</div>
<div class="pagebreak"></div>
</body>
</html>
The second image screenshots are from ebooks I bought, and, as you can see, in those header and footers work.
It's more than a week I'm consuming my brain over this issue. I even compared my work with the ones of 4 different publishers and found nothing different in them.

It must be something in the toc or in the opf file, but I can't find what it is.Everything looksright. Maybe some hidden Sigil settings?