This comes from Factorio 2.1 removing LuaEntity.fluidbox. In prototypes/scripts/turrets.lua, local_replace_turret collects the old turret's fluids, but the code that would put them back is commented out, so the loop can simply be deleted (around line 184):
local fluid = {}
-- delete from here ...
if entity.fluidbox ~= nil then
for k = 1, #entity.fluidbox do local fb = entity.fluidbox[k]
if fb ~=nil and fb.name ~= nil then
table.insert(fluid,fb)
end
end
end
-- ... to here
On 2.1 the rank recipes also need one change in prototypes/scripts/types.lua (around line 689), because 2.1 ignores category on recipes:
-- before
category = turret.recipe.category,
-- after
categories = turret.recipe.categories or (turret.recipe.category and {turret.recipe.category}) or nil,
With both changes, a 2.1.21 save with ~1800 ranked turrets loads, migrates and runs a headless test without script errors. I haven't yet confirmed a rank-up in normal play.
Otherwise, HeroTurretsReduxFork (linked in the "[Use this] 2.1 update" thread) is the maintained 2.1 version, endorsed by the author there, and it already handles this.