When DEBUG=False is returning error 500 in template "otp_form.html" rendering.
This is occuring because in the release 5.1 of wagtail they are not using anymore the image "wagtailadmin/images/wagtail-logo.svg", and this is linked in the template:
{% block branding_logo %}
{% endblock %}