Adding MimeType=x-scheme-handler/xyz;
to data/package.desktop.in isn't helping.
It seems that the app has to be installed for the x-scheme-handler to be detected, merely running it from GNOME Builder won't help.
Steps for installation:
Click on the Build from the omnibar, followed by Export Bundle in the same dropdown.
Open a terminal in the directory that opened after the export was done.
Run flatpak install yourapp.flatpak
Thanks to developers in Matrix chatroom for helping out.