Composer: require dev branch then go back to stable once current dev is stable
You should better use a patch.

You will ask composer to download and install the required patch on top of the current stable release. 

Once the patch will be inside the stable release, the patch won't be applied anymore (a patch is basically a diff file, so when there's no diff, there's not patch)

Install https://github.com/cweagans/composer-patches this is a dependencies that will allow to use a section in the composer.json to declare the patch. It will install it automatically. 

composer require cweagans/composer-patches

Then add an extra section in your composer.json

"extra": {
    "enable-patching": true,
    "patches": {
        "drupal/module_to_be_patched": {
            "&lt;patch1 information&gt;": "&lt;patch1 file path&gt;",
            "&lt;patch2 information&gt;": "&lt;patch2 file path&gt;"
        }
     }
}


You will find the patch file path on the module tracker, on the repository of the module, for an issue

For exemple, successive patches for a drupal/webform issue : https://www.drupal.org/project/webform/issues/3137981

Then simply 

composer install


You will see the patch is being installed right in your terminal.

Reference : https://groups.drupal.org/node/518975

Patching : https://www.drupal.org/patch/apply