Yeah, you probably accidentally dropped it instead of putting into the chest and the book despawned. You can’t really retrieve it unless you had an older back-up of your world on your device.
In Minecraft 1.12.2, you can summon a squid by doing /summon minecraft:squid [x] [y] [z] You can adjust the coordinates or just summon the squid where you’re standing by just replacing the variables with ~. e.g /summon minecraft:squid ~ ~ ~
Since you’re using a command block I’d recommend settling the coordinates.