Hi Ajai,
I can understand that you are facing issue while using ‘MATLAB Engine API for Python’. The error you're encountering is due to the fact that you're passing a Python lambda function (func) to the eng.fsolve function, which expects a MATLAB function handle.
I would suggest to code ‘func’ function in MATLAB script and then use that script in python script.
For more information on using MATLAB script in python, refer to the following documentation: -https://www.mathworks.com/help/matlab/matlab_external/call-user-script-and-function-from-python.html