I figured out some workaround. I noticed, that in the returned struct the functions and files were obviously given with directories on the computation cluster. I then just iterated over the struct replacing all paths with the corresponding paths, i.e. as if the program were to be run on my local machine. And indeed, that just did the trick. I can now view the report on my local machine.
For curiosity: That probably is not the "official" way to do it. Is there something I missed?
For completeness, here is the code for the path replacement:
function NewReport = replacePathsInProfileReport(Report)
LOCAL_CODE_AT = '\\Local\path\\to\\my\\own\\code\\';
LOCAL_TOOLBOX_AT = 'C:\\Program Files\\MATLAB\\R2021b\\toolbox\\';
CLUSTER_CODE_AT = '/cluster/path/to/the/transferred/temporary/files/';
CLUSTER_TOOLBOX_AT = '/cluster/path/to/the/matlab/toolbox/';
NewReport = Report;
for worker=1:size(NewReport,1)
for fcn=1:size(NewReport(worker).FunctionTable,1)
NewReport(worker).FunctionTable(fcn).CompleteName = regexprep(NewReport(worker).FunctionTable(fcn).CompleteName,CLUSTER_TOOLBOX_AT,LOCAL_TOOLBOX_AT);
NewReport(worker).FunctionTable(fcn).CompleteName = regexprep(NewReport(worker).FunctionTable(fcn).CompleteName,CLUSTER_CODE_AT,LOCAL_CODE_AT);
NewReport(worker).FunctionTable(fcn).CompleteName = regexprep(NewReport(worker).FunctionTable(fcn).CompleteName,'/','\\');
NewReport(worker).FunctionTable(fcn).FileName = regexprep(NewReport(worker).FunctionTable(fcn).FileName,CLUSTER_TOOLBOX_AT,LOCAL_TOOLBOX_AT);
NewReport(worker).FunctionTable(fcn).FileName = regexprep(NewReport(worker).FunctionTable(fcn).FileName,CLUSTER_CODE_AT,LOCAL_CODE_AT);
NewReport(worker).FunctionTable(fcn).FileName = regexprep(NewReport(worker).FunctionTable(fcn).FileName,'/','\\');
end
end
end