There are a variety of frozen desserts which are all related. The main difference between ice cream and frozen custard is the amount of eggs used to thicken the base mix.
Philadelphia style ice cream is made from a base mix of milk and/or cream, sugar, and flavorings.
French (or simply plain) ice cream is made from a base mix which is essentially a very thin custard or creme anglaise: milk and/or cream, sugar, and flavorings thickened with egg yolks or whole egg. The base mix is cooked to thicken, and then chilled prior to churning.
Frozen custard is very similar to French style ice cream, but with a greater ratio of eggs or egg yolks to dairy or liquid in the mix.
With this information, you can adapt nearly any custard recipe to be freezable as ice cream or frozen custard.
My survey of frozen custard recipes indicates a ratio of eggs to dairy of about 5 egg yolks to three cups (700 mL) dairy, or 6 whole eggs to 4 cups (1 L) of dairy.
To adapt any custard recipe for freezing, then:
Adjust the ratio of egg yolks to dairy to no more than about 5 yolks per 3 cups dairy.
You may also want to adjust the total yield to be based on no more than 3 cups dairy depending on the capacity of your ice cream maker. Many home ice cream makers have a 1 quart (close to 1 L) capacity, but you need to leave room for the air which will be incorporated as the mix is churned.
I recommend not using whole eggs for frozen custards, as the yolks facilitate a better texture, and create the rich eggy custard flavor.
Frozen desserts are served colder than custards normally are, so the flavors will be more muted. You may need to compensate by increasing the ratio of flavoring ingredients.
This will be hard to judge until you have made the frozen custard/ice cream at least once.
Cook the custard until it thickens on the stove top, per the normal custard method.
Chill it rapidly for safety, and then hold it for at least 4 hours (overnight is even better). While I cannot explain the science, empirically, allowing the mix to mature lets the flavors meld and produces a better frozen dessert.
Churn it into a frozen dessert according to the instructions of your particular ice cream maker.
Note that you can even convert a custard recipe into a Philadelphia style ice cream by eliminating the eggs completely, and simply creating a dairy/sugar/flavoring mix. These still benefit from overnight maturation before churning.
You did absolutely nothing wrong; this is completely normal.
When exposed to the air, custards (and other hot milk products, like real hot chocolate made with actual milk) will form a skin as the proteins irreversibly polymerize. This is analogous to the way a skin will form on the top of a paint can left open.
You can prevent the skin by pressing film wrap or parchment directly onto the surface of the custard, preventing air contact after it is cool enough (tough to do with baked custards, but you can peel the skin if you do not wish to serve it). Of course, this is a trade off, as you will affect the surface appearance of the custard when you remove the covering.
Side note: the skin is perfectly edible; some people like it, others do not.
Best Answer
It sounds like your custard was overcooked, causing the proteins to break down. This can easily happen when you make custard in a pan. By the time you realize it's happening it's too late. Try using a double boiler instead, or improvise one using a pot with water and a bowl.
Also, don't cook it too long, it should still be somewhat runny when hot. If you cook until it gets really thick that's too long, cook it only long enough that you see a change in consistency.
If it does start to curdle pour it out into something else right away, and use a stick blender on it, that may save it.
Here's a good page that gives examples of typical custard problems and how to avoid them.