macOS custom keyboard layout is removed each restart of the OS
Try putting a copy of your custom keyboard layout in ~/Library/Keyboard Layouts directory. The Library directory in your Home directory is hidden by default. To enter it, click Go in Finder menu, press and hold the Option key to reveal Library option.