Preheat oven to 400 degrees F (200 degrees C). Prepare a 9×13-inch baking dish with cooking spray.
Spread one of the puff pastries into the bottom of the prepared baking dish, stretching so it reaches the edges.
Bake pastry in preheated oven until lightly browned, about 5 minutes.
Beat egg yolks in a stainless steel bowl until smooth. Add macapuno strings, softened butter, and vanilla to the egg yolks; stir.
Place the stainless steel bowl over a pot of boiling water; cook the macapuno mixture, stirring frequently, until it thickens, about 5 minutes. Pour over the baked puff pasty and spread into an even layer. Stretch the unbaked puff pastry over the top of the macapuno layer.
Bake in preheated oven until top layer is golden brown, about 18 minutes. Cool to room temperature.