Going to need more information, there’s nothing in the code you’ve provided that would explain why it’s not working.
Let’s start with your field group. Please export your field group and attach it, you’ll probably need to put it in a .zip file to attach it here.