The chromosome order of the reference genome and your file must still be different.
Did you try sorting using the instructions above? Using a reference genome from the history?
Is this the tutorial you are running through? DNA Methylation data analysis
The tutorial files were curated to not need an extra sort step. When using your own data, that can situation can differ.
If the files do not work directly from the upstream tools, and sorting without using a reference genome is not enough, then you’ll probably need to do that full sort again using one. That reference genome should be the same exact reference genome used for mapping.
This can get more complicated depending on where the data was sourced, if a custom genome is involved, etc. Technically, the tool is comparing the BED to the FASTA to do manipulations – and processes those in order. If it finds lines that are not in the same order, it will fail. Maybe check that the chromosome identifiers are actually in the same exact format between the two and in the same order?
This all assumes that the sort order is the actual problem and the content/format of your files is otherwise Ok. These tools can help when performing extra checks when manipulating data to make complicated tools happy: Data Manipulation Olympics
If you need more help, please share more details. Copy/paste the full job information (inputs, parameters) and stderr/stdout logs and consider sharing a history link plus the exact tutorial/step. This is the information we are looking for: Troubleshooting errors and What information should I include when reporting a problem?
Let’s start there