In the shared MATLAB Answer, the suggestion is to use "copyobj" to copy the graphics object and save the copied object. This approach may not be copying all the other properties such as font size which results in different font sizes while saving.
To address the issue, you can use "exportgraphics" function to export and save the axes object to an image file. Here is a simple code example for the same.
    text(app.UIAxes, 6, 6, '40')
    text(app.UIAxes, 6.3, 6, '41')
    fontsize(app.UIAxes, 7, 'points')
function ButtonPushed(app, event)
    exportgraphics(app.UIAxes, 'exportFig.jpg')
The saved image also has same font size.
To learn more about 'exportgarphics', please go through the official MATLAB documentation using the command in the MATLAB command window.
web(fullfile(docroot, 'matlab/ref/exportgraphics.html'))