The first screenshot you shared showed you are running a very outdated version of the plugin. As you may have noticed after updating, the Yoast SEO metabox is now different.
Getting back to the issue you are experiencing, that is, the Yoast SEO meta box moved from under the default WordPress content editor to the sidebar and you want to move it back, there is a reported issue with the Gutenberg where the meta boxes under the content can be pushed to the sidebar, sometimes accidentally. In short, the under content and sidebar list of boxes appear to be a single list.
Luckily, you can drag and drop the meta boxes between the sidebar and under the content. Additionally, you can use the up/down arrows to move between the sidebar and under content areas. In some cases, you may need to have at least one meta box available to move the boxes between the two areas. See screenshot.
See below for more details):
1. Make sure you are in the correct sidebar. The gear icon (1) should be selected and you should be in the ‘Document’ (2) section.
2. Make sure you move the correct panel. The top ‘Yoast SEO’ (3) panel cannot be moved. Scroll down and look for the second ‘Yoast SEO’ (4) with the up/down arrows.
3. If the ‘up’ arrow is gray, enable the ‘Custom fields’ or another meta box. You can do this under the kebab (three-dot) menu (5) > Options.
4. Be patient. It may take a little trial and error to determine which option works best for you.