The free environment comes with a database and can’t be connected to a separate database as you are doing locally.
Restoring the cloud database you have on the free environment is not possible, this is only available for licensed cloud nodes. See the documentation at: https://docs.mendix.com/developerportal/operate/restore-backup#4-restoring-a-backup-for-a-free-app