C# (Visual C# Interactive Compiler), 7675 bytes
a=>b=>a.Select((x,y)=>Math.Max(9-x<(y=y<b.LengthCount?b[y]:0)?9-x:y,9-y<x?9-y:x))
Saved 6 bytes duethanks to @someone
C# (Visual C# Interactive Compiler), 76 bytes
a=>b=>a.Select((x,y)=>Math.Max(9-x<(y=y<b.Length?b[y]:0)?9-x:y,9-y<x?9-y:x))
Saved 6 bytes due to @someone
C# (Visual C# Interactive Compiler), 75 bytes
a=>b=>a.Select((x,y)=>Math.Max(9-x<(y=y<b.Count?b[y]:0)?9-x:y,9-y<x?9-y:x))
Saved 6 bytes thanks to @someone
C# (Visual C# Interactive Compiler), 8276 bytes
a=>b=>a.Select((x,y)=>Math.Max(Math.Min(9-x,x<(y=y<b.Length?b[y]:0),Math.Min(?9-x:y,9-y<x?9-y:x)))
Try it online! Saved 6 bytes due to @someone
C# (Visual C# Interactive Compiler), 82 bytes
a=>b=>a.Select((x,y)=>Math.Max(Math.Min(9-x,y=y<b.Length?b[y]:0),Math.Min(9-y,x)))
C# (Visual C# Interactive Compiler), 76 bytes
a=>b=>a.Select((x,y)=>Math.Max(9-x<(y=y<b.Length?b[y]:0)?9-x:y,9-y<x?9-y:x))
Saved 6 bytes due to @someone
C# (Visual C# Interactive Compiler), 82 bytes
a=>b=>a.Select((x,y)=>Math.Max(Math.Min(9-x,y=y<b.Length?b[y]:0),Math.Min(9-y,x)))