Unexpected square appear in pure python, but occasionally when pyinstaller-packed

My simple wx app has only one wx.lib.FileBrowseButton & a wx.TextCtrl. It functions normal, but always with a unexpected square appear in the left-top corner, see below screen-shot.
https://ibb.co/ryqCsnx

And if I pack my app with pyinstaller, this square will not always appear.
Here is the app code:

# coding: utf-8

import logging
import os
import time
import sys

import wx
import wx.lib.filebrowsebutton as filebrowse


class FWScripterPanel(wx.Panel):
    """
    """

    def __init__(self, parent, ID):
        wx.Panel.__init__(self, parent, ID)

        self.fbb = filebrowse.FileBrowseButton(self, wx.ID_ANY, size=(450, -1), changeCallback = self.fbbCallback, labelText='HEX', buttonText='Select HEX', fileMask='*.hex', toolTip='Select & transfer a HEX file to script')

        style = wx.TE_MULTILINE | wx.TE_READONLY | wx.HSCROLL
        self.log = wx.TextCtrl(self, wx.ID_ANY, '', size=(-1, -1), style=style)

        sizer = wx.BoxSizer(wx.VERTICAL)
        sizer.Add(self.fbb, 0, wx.ALL|wx.EXPAND, 5)
        sizer.Add(self.log, 1, wx.ALL|wx.EXPAND, 5)
        self.SetSizer(sizer)

    def fbbCallback(self, evt):
        path = evt.GetString()
        logging.info(path)
        self.make_script(path)

    def make_script(self, hex_path):
        """
        """
        pass


class FWScripterFrame(wx.Frame):
    """
    """

    def __init__(
            self, parent, ID, title, pos=wx.DefaultPosition,
            size=(800,600), style=wx.DEFAULT_FRAME_STYLE
            ):

        wx.Frame.__init__(self, parent, ID, title, pos, size, style)
        panel = FWScripterPanel(self, -1)


class App(wx.App): 
    """
    """

    def OnInit(self): 
        frame = FWScripterFrame(parent=None, ID=-1, title='20220208') 
        frame.Show() 
        return True 


def main():
    app = App() 
    app.MainLoop()


if __name__ == '__main__':
    FORMAT = '%(asctime)s - %(levelname)s - %(name)s - %(message)s'
    datefmt = '%Y-%m-%d %H:%M:%S'
    logging.basicConfig(level=logging.DEBUG, format=FORMAT, datefmt=datefmt)

    main()

Finally I solve the problem by adding one line ‘self.Layout()’ in the FWScripterPanel.init(), see below.

class FWScripterPanel(wx.Panel):
    def __init__(self, parent, ID):
        wx.Panel.__init__(self, parent, ID)

        self.fbb = filebrowse.FileBrowseButton(self, wx.ID_ANY, size=(450, -1), changeCallback = self.fbbCallback, labelText='HEX', buttonText='Select HEX', fileMask='*.hex', toolTip='Select & transfer a HEX file to script')

        style = wx.TE_MULTILINE | wx.TE_READONLY | wx.HSCROLL
        self.log = wx.TextCtrl(self, wx.ID_ANY, '', size=(-1, -1), style=style)

        sizer = wx.BoxSizer(wx.VERTICAL)
        sizer.Add(self.fbb, 0, wx.ALL|wx.EXPAND, 5)
        sizer.Add(self.log, 1, wx.ALL|wx.EXPAND, 5)
        self.SetSizer(sizer)
        self.Layout()  # Add this line to solve the 'square' issue

WhenAndHowToCallLayout
The above link provides quite a lot helpful information. Wish it helps.