I tested the following sample: https://github.com/azure-ad-b2c/samples/tree/master/policies/pwd-reset-via-email-or-phone
However, I want to add the TOTP option to this page. I tried using the following sample but it is not giving me the expected result. Any inputs?

In your scenario, you can select either TOTP or SMS/call as authentication method but not both.
I tried to reproduce the same in my environment and got the below results:
When I selected authentication method as SMS or phone call, user is prompted for MFA like below:
To enable
TOTPoption, update the user flow by changing authentication method like below:When the user ran the user flow, it prompted for MFA to scan
QR codelike below:After clicking Continue, they will get
OTPin their Microsoft Authenticator app where they need to enter that code here:Like this, you can enable TOTP as MFA method. But you cannot add this with SMS or Phone call as you can chose only one authentication method.