Erro with modal

An error is appearing every time I open a bootstrap modal.

This is my structure to open it:

HTML

	<div class="modal fade" role="dialog" tabindex="-1" id="modal">
        <div class="modal-dialog modal-dialog-centered modal-dialog-scrollable" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h4 class="modal-title">Modal Title</h4><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button></div>
                <div class="modal-body" id="modalBody"></div>
            </div>
        </div>
    </div>

DELPHI

Panel1.ElementID := 'modalBody';
	frmModal := TFormModal.CreateNew(Panel1.ElementID, nil);
	asm
		$("#modal").modal();
	end;

Every time I execute this function to open the form and then to open the modal, it always returns this error:

Uncaught TypeError: Cannot read property 'getBoundingClientRect' of null
at Object.XYToClient (WEBLib.Controls.pas: 3503)
at Object.HandleDoMouseMove (WEBLib.Controls.pas: 3932)
at HTMLDivElement.cb (rtl.js: 217)
at HTMLDivElement.sentryWrapped (helpers.ts: 85)

As much as this error returns to me, the modal continues to work normal and the elements of the form also continue to work, but even so I would like to make this error no longer happen.

Can you please send a test project instead of expecting us to glue & guess code snippets together.