The first time I tried this was on Normal difficulty. I died the first time. The second time I only used a couple stimpacks.
The most important thing is to be inside when the queen is attacking. You can easily dodge her ranged poison attack from there. You can also fight any babies that come your way without worrying about the queen. It also helps to lay down mines on the break in the wall where she comes in. Just like with any other boss chems can be useful, especially Psycho.
Inside the walls, there is a missile launcher, along with some missiles. I can't recall exactly how many, but I think it was at least seven scattered about. Pick those up. There's also a flamer and a decent amount of flamer fuel, but I didn't want to get that close to her. The flamer might work well on the babies.
From inside, I stood in the doors and shot missiles at her. You don't need to use VATS for this, even if you normally use it for all your shots. Just aim at the lower part of her body, under the shell, and fire. Whenever she looked my way, I ran to another door and avoided the ranged attack. It leaves some harmful mist behind, so don't run right back into it. This attack does poison damage, which ignores your ballistic and energy resistances. You can get poison resistance from the "Poisoner's" legendary armor effect, and also from Astoundingly Awesome Tales #5: The Mad Russian's Revenge, which can be found in Pickman Gallery.
That character wasn't that good at combat, but after firing all the missiles I was able to finish the queen off with some combat rifle shots.
I've since defeated the queen on Hard, Very Hard, and Survival. This basic strategy continues to work, although you're going to need more missiles. In future playthroughs, I've saved all the missiles I've run into, rather than selling them. This gives me dozens by the time I get to the castle.
If you can do good ranged damage, especially if you can do a lot of crits, you might be able to kill her easily enough with your regular gun. The queen's head is weak, just like other mirelurks. If you can't hit the head, the rest of her body is still weaker than the shell. If you have Macready's perk, Killshot, then hitting her head is extremely easy, and the whole fight shouldn't be too much trouble.
If you pass the persuasion test in the initial conversation, Sully simply remarks that he might want to use the quarry to dump bodies.
To quote the fallout wiki;
After the player character completes the Pull the Plug quest and leaves the quarry, upon returning after a while, they will find that it has become occupied by a large band of raiders. Descending to the bottom will lead to a confrontation with a masked, well-armored Sully Mathis, who may be difficult to defeat at lower levels. If the Sole Survivor found Sully's journal holotape, they can discern he was already a Raider.
Best Answer
There's a number of steps you should take in order to deal with this issue:
First, are you using any mods? Any mods that interact with workshops/settlements/the tunnels beneath the castle are known to interact poorly with this quest. Disable any mods you might be using and see if that helps.
Second, have you cleared all Mirelurks and Mirelurk nests within the castle? Some of the nests are in hidden in strange spots--around the back parapets, in the bedrooms of the castle--and if your NPC allies tried to clear them out on their own sometimes not all of the hostile eggs within the nest will trigger. The Castle won't be considered allied to you until every nearby hostile is cleared out, including hostile Mirelurk hatchlings still in their eggs, so make sure everything's dead.
Third, there is a known glitch where you get the 'not allied to this settlement' message when attempting to interact with the workbench even after anything is dead. You can see discussion of it here and here at the Steam forums for the game. (It seems that this glitch may come from an enemy falling beneath the map, or the game not considering all enemies dead even when they are.) On PC, players have reported success in fixing it by using the 'killall' command; however, since you're on PS4, if you are in fact seeing this glitch your best bet is to reload from an earlier save and re-attempt the quest. There may also be a mod available on the PS4 that gives you access to the console to allow you to try console commands as a fix--I'm not sure what the current state of PS4 mods for this game is.