I have started two games with my mod and got the Pirate Notification without any pirate shipyards spawning. I used the console and fow command to verify it. I then started several games and used the console and "event SpawnPirates" command to spawn them on turn 1. They spawned every time. I don't know why they didn't spawn in the games without the command. I still think there is bug that happens sometimes.
Have you figured out how to restore them to having bases at the beginning?
I haven't tried to do it in a mod, and I'm not sure if it will work.
If you want to guarantee they are there at the beginning of the game, do what I did. Use the console to enter the "event SpawnPirates" command to get them to appear immediately. Be sure to use the capital letters or it won't work. Of course, don't use the quotes. If you want more, use the command as many times as you want.