–shardsvr is a configuration used in a sharded cluster. If this is a single node / standalone then you don’t need this setting. The node is looking for a sharded cluster to be added too but there isn’t one. If you look in the logs you will see a message “sharding state not initialized”.
If you want to set up a development MongoDB server that supports transactions, you can convert your standalone server to a single-member replica set: Convert a Standalone to a Replica Set.
Transactions are only supported in a replica set or sharded cluster deployment because transactions require an operations log (oplog) with the history of data changes.
You’re almost there based on your first post, but:
As suggested by @tapiocaPENGUIN, remove the --shardsvr parameter since you are not creating a sharded cluster
Run rs.initiate() to initiate the new replica set (only required once, when you create a new replica set)
Connect to this deployment using a replica set connection string. Based on your post above, that should be similar to: