-- Add the Profiles UI as a subcategory below the main options
Since db was added to GUB in main.lua. I use the reference here as self.db to get that.
I highlighted the incorrect database reference. The function is a member of GUB.Options, and not a member of GUB, so the "self" you're referencing will not have your db in it. Replace "self.db" with "GUB.db".
Why does that matter? What should matter is how you want your AddOn to behave.
However, it does seem that most I have come across do not do this, and force users to set up profiles for every character - the exceptions to this are usually by authors who are well established or simply realize that unnecessary re-configuration is maddening.
Not to say that this behavior is always undesirable; it is wholly dependent upon the intent and function of the AddOn.