Using transactions I try to change a fragment in my Activity, but the previous fragment stays as where it was and a new one covers it:

This is how I change the fragments:
WorkoutDetailFragment details = new WorkoutDetailFragment();
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
details.setWorkout(id);
ft.replace(R.id.stopwatch_container, details);
ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
ft.addToBackStack(null);
ft.commit();
How can I prevent it?
UPD: Here's acivity_main.xml file:
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:padding="16dp"
tools:context=".StopwatchFragment" >
<fragment
android:id="@+id/fragment2"
android:name="com.example.workout.WorkoutListFragment"
android:layout_width="160dp"
android:layout_height="wrap_content"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<FrameLayout
android:id="@+id/stopwatch_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintStart_toEndOf="@+id/fragment2"
app:layout_constraintTop_toTopOf="parent">
<fragment
android:id="@+id/fragment3"
android:name="com.example.workout.WorkoutDetailFragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</FrameLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
UPD2: I've found the solution. I just kept the fragment view nested in a frame layout. Instead, having used fragment transactions I added the fragment directly into frame layout in code.