Page ids are converted to lowercase when added with B4XPages.AddPage because they become keys in an internal Map.
We need to know more about your page naming convention to find the best way to recover the original caseness.
However you can always keep a global Map that converts lowercase names back to original names.
AKA = also known as
Note that page names in all B4XPages Sub arguments are case insensitive, so you may not need the original name.
B4X:
'In B4XMainPage Sub Class_Globals
'Public AKA As Map
Private Sub B4XPage_Created (Root1 As B4XView)
AKA.Initialize
Dim thisXPage As XPage
thisPAge.Initialize
B4XPages.AddPage("InstanceName", thisPage)
AKA.Put("InstanceName".ToLowerCase, "InstanceName")
'...
End Sub
'In XPage code
log(B4XMainPages.MainPage.AKA.Get(B4XPages.GetPageId(Me)))