Issues using TWebTimer

Hello, I've some issues using TWebTimer. I wrote this code

unit View.Main;

interface

uses
System.SysUtils, System.Classes, JS, Web, WEBLib.Graphics, WEBLib.Controls,
WEBLib.Forms, WEBLib.Dialogs, Vcl.Controls, Vcl.StdCtrls, WEBLib.StdCtrls,
WEBLib.ExtCtrls, XData.Web.Connection, XData.Web.Client;

type
TfrmMain = class(TWebForm)
tmrMain: TWebTimer;
lblOrario: TWebLabel;
btnRegistrazioneManuale: TWebButton;
btnStorico: TWebButton;
edtCodiceRFID: TWebEdit;
XDataWebClient1: TXDataWebClient;
XDataWebConnection1: TXDataWebConnection;
procedure tmrMainTimer(Sender: TObject);
procedure WebFormCreate(Sender: TObject);
procedure edtCodiceRFIDKeyPress(Sender: TObject; var Key: Char);
procedure XDataWebConnection1Error(Error: TXDataWebConnectionError);
procedure btnRegistrazioneManualeClick(Sender: TObject);
procedure btnStoricoClick(Sender: TObject);
private
{ Private declarations }
procedure InternalAfterRegistrazionePerformed(Response: TXDataClientResponse);
procedure HideMain(AForm: TObject);
procedure ShowStorico(Response: TXDataClientResponse);
procedure ShowMain;
public
{ Public declarations }
end;

var
frmMain: TfrmMain;

implementation

uses
Winapi.Windows, View.SelezioneUtente, View.NotificaRegistrazione,
View.Storico;

{$R *.dfm}

procedure TfrmMain.InternalAfterRegistrazionePerformed(Response: TXDataClientResponse);
var
LfrmNotificaRegistrazione: TfrmNotificaRegistrazione;
procedure OnCreateFormReg(AForm: TObject);
var
LValue: JsValue;
begin
TfrmNotificaRegistrazione(AForm).IDRegistrazione:= integer(TJSObject(Response.Result)['Id']);
TfrmNotificaRegistrazione(AForm).IDUtente:= integer(TJSObject(TJSObject(Response.Result)['Utente'])['Id']);
end;
procedure AfterShowModalNotifica(AModalResult: TModalResult);
begin
ShowMain;
end;
begin
LfrmNotificaRegistrazione:= TfrmNotificaRegistrazione.CreateNew(@OnCreateFormReg);
LfrmNotificaRegistrazione.ShowModal(@AfterShowModalNotifica);
end;

procedure TfrmMain.ShowMain;
begin
tmrMain.Enabled:= true;
end;

//procedure TfrmMain.ShowStorico(aIdUtente: integer); ORIGINAL VERSION
procedure TfrmMain.ShowStorico(Response: TXDataClientResponse);
var
LfrmStorico: TfrmStorico;
procedure AfterCreateFrmStorico(AForm: TObject);
begin
TfrmStorico(AForm).IdUtente:= 1;
end;

procedure AfterShowModal(AModalResult: TModalResult);
begin
ShowMain;
end;

begin
LfrmStorico:= TfrmStorico.CreateNew(@AfterCreateFrmStorico);
LfrmStorico.ShowModal(@AfterShowModal);
end;

procedure TfrmMain.btnRegistrazioneManualeClick(Sender: TObject);
var
LfrmSelezioneUtente: TfrmSelezioneUtente;

procedure AfterSelezioneUtenteShowModal(AValue: TModalResult);
var
LIdUtente: integer;
i: integer;
begin
LIdUtente:= LfrmSelezioneUtente.IdUtente;
if LIdUtente > 0 then
XDataWebClient1.RawInvoke('IRegistratoreServices.RegistraUtenteById',[LfrmSelezioneUtente.IdUtente], @InternalAfterRegistrazionePerformed)
else
begin
ShowMain;
end;

end;
begin
LfrmSelezioneUtente:= TfrmSelezioneUtente.CreateNew(@HideMain);
LfrmSelezioneUtente.ShowModal(@AfterSelezioneUtenteShowModal);
end;

procedure TfrmMain.btnStoricoClick(Sender: TObject);
var
LfrmSelezioneUtente: TfrmSelezioneUtente;
procedure AfterSelezioneUtenteShowModal(AValue: TModalResult);
var
LIdUtente: integer;
i: integer;
begin
LIdUtente:= LfrmSelezioneUtente.IdUtente;
if LIdUtente > 0 then
begin
// ShowStorico(LIdUtente) ORIGINAL
XDataWebClient1.RawInvoke('IRegistratoreServices.step',[],@ShowStorico);
end
else
begin
showMain;
end;

end;
begin
LfrmSelezioneUtente:= TfrmSelezioneUtente.CreateNew(@HideMain);
LfrmSelezioneUtente.ShowModal(@AfterSelezioneUtenteShowModal);
end;

procedure TfrmMain.edtCodiceRFIDKeyPress(Sender: TObject; var Key: Char);
begin
if ord(key) = VK_RETURN then
begin
try
XDataWebClient1.RawInvoke('IRegistratoreServices.RegistraUtente',[edtCodiceRFID.Text],@InternalAfterRegistrazionePerformed);
edtCodiceRFID.Text:= '';
except
on E: Exception do
showmessage(E.Message);
end;
end;
end;

procedure TfrmMain.HideMain(AForm: TObject);
begin
tmrMain.Enabled:= false;
end;

procedure TfrmMain.WebFormCreate(Sender: TObject);
begin
lblOrario.Caption:= formatdatetime('dd mmmm yyyy, hh:nn:ss',now);
tmrMain.Enabled:= true;
edtCodiceRFID.SetFocus;
end;

procedure TfrmMain.tmrMainTimer(Sender: TObject);
begin
lblOrario.Caption:= formatdatetime('dd mmmm yyyy, hh:nn:ss',now);
edtCodiceRFID.SetFocus;
end;

procedure TfrmMain.XDataWebConnection1Error(Error: TXDataWebConnectionError);
begin
Showmessage(Error.ErrorMessage);
end;

end.

The problem is that with both buttons LfrmSelezioneUtente is correctly shown, than, with btnRegistrazioneManuale there's the correct service invoke, LfrmNotificaRegistrazione is correctly shown and I haven't got any exception; if I use btnStorico with the original version of ShowStorico, after LfrmSelezioneUtente, I get this exception:

Error: Duplicate component name: "tmrMain" at Object.Create$1 (http://localhost:8000/MarcaTempoRegistratore/MarcaTempoRegistratore.js)

If I use the current version of ShowStorico, where I invoke a "mock" service, everything works well.
Could it be a bug or is there somenthing I can't get?
Thanks in advance.