You should be able to do this without knowing anything about this mod or its code, but it's not exactly the same as you may have been doing it before. Based on that stack trace, it seems like you were concatenating your own name with the names of some Planets (therefore their Surfaces?) to find the right recipe. You're on the right track for checking the Surface Properties instead of that.
The harder part is that you mentioned matching properties. Technically, these properties can change at runtime, even though they're initialized from the Prototypes. You can read the current value of any of the properties for a Surface, so by just using the Factorio APIs, you should be able to handle this for any situation - not just for this mod. By now you may have realized the complication with matching: there's multiple properties and each can be adjusted individually, so how will you match? I hope you have only a couple of properties that matter, but it doesn't sound like it if you wanted it to be specific to each Planet.
I don't know of any other mod that I've used that also lets users adjust the properties; this mod does, but I'm betting that users mostly use the preset options that use all the values of a known Planet's Prototype. That means your matching will likely succeed, but you still have to wonder about the cases when it's not a perfect match.